PatternSynonyms.tex 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. \documentclass{article}
  2. \usepackage{agda}
  3. \begin{document}
  4. \begin{code}%
  5. \>[0]\AgdaKeyword{data}\AgdaSpace{}%
  6. \AgdaDatatype{Nat}\AgdaSpace{}%
  7. \AgdaSymbol{:}\AgdaSpace{}%
  8. \AgdaPrimitive{Set}\AgdaSpace{}%
  9. \AgdaKeyword{where}\<%
  10. \\
  11. \>[0][@{}l@{\AgdaIndent{0}}]%
  12. \>[2]\AgdaInductiveConstructor{zero}\AgdaSpace{}%
  13. \AgdaSymbol{:}\AgdaSpace{}%
  14. \AgdaDatatype{Nat}\<%
  15. \\
  16. %
  17. \>[2]\AgdaInductiveConstructor{suc}\AgdaSpace{}%
  18. \AgdaSymbol{:}\AgdaSpace{}%
  19. \AgdaDatatype{Nat}\AgdaSpace{}%
  20. \AgdaSymbol{→}\AgdaSpace{}%
  21. \AgdaDatatype{Nat}\<%
  22. \\
  23. %
  24. \\[\AgdaEmptyExtraSkip]%
  25. \>[0]\AgdaKeyword{module}\AgdaSpace{}%
  26. \AgdaModule{PatternSyns}\AgdaSpace{}%
  27. \AgdaKeyword{where}\<%
  28. \\
  29. \>[0][@{}l@{\AgdaIndent{0}}]%
  30. \>[2]\AgdaKeyword{pattern}\AgdaSpace{}%
  31. \AgdaInductiveConstructor{two}%
  32. \>[16]\AgdaSymbol{=}\AgdaSpace{}%
  33. \AgdaInductiveConstructor{suc}\AgdaSpace{}%
  34. \AgdaSymbol{(}\AgdaInductiveConstructor{suc}\AgdaSpace{}%
  35. \AgdaInductiveConstructor{zero}\AgdaSymbol{)}\<%
  36. \\
  37. %
  38. \>[2]\AgdaKeyword{pattern}\AgdaSpace{}%
  39. \AgdaInductiveConstructor{three}\AgdaSpace{}%
  40. \AgdaSymbol{=}\AgdaSpace{}%
  41. \AgdaInductiveConstructor{suc}\AgdaSpace{}%
  42. \AgdaInductiveConstructor{two}\<%
  43. \\
  44. %
  45. \\[\AgdaEmptyExtraSkip]%
  46. \>[0]\AgdaKeyword{open}\AgdaSpace{}%
  47. \AgdaModule{PatternSyns}\AgdaSpace{}%
  48. \AgdaKeyword{using}\AgdaSpace{}%
  49. \AgdaSymbol{(}\AgdaInductiveConstructor{two}\AgdaSymbol{)}\AgdaSpace{}%
  50. \AgdaKeyword{renaming}\AgdaSpace{}%
  51. \AgdaSymbol{(}\AgdaInductiveConstructor{three}\AgdaSpace{}%
  52. \AgdaSymbol{to}\AgdaSpace{}%
  53. \AgdaInductiveConstructor{three′}\AgdaSymbol{)}\<%
  54. \\
  55. %
  56. \\[\AgdaEmptyExtraSkip]%
  57. \>[0]\AgdaKeyword{data}\AgdaSpace{}%
  58. \AgdaDatatype{Bot}\AgdaSpace{}%
  59. \AgdaSymbol{:}\AgdaSpace{}%
  60. \AgdaPrimitive{Set}\AgdaSpace{}%
  61. \AgdaKeyword{where}\<%
  62. \end{code}
  63. \end{document}