Guest User

Untitled

a guest
Jan 16th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. documentclass[a4paper]{article}
  2. usepackage{amsmath}
  3. usepackage{calc}
  4.  
  5. newcommand{mv}[1]{% metavariable
  6. mathit{#1}%
  7. }
  8. newcommand{sor}{% syntax or
  9. mathrel{makebox[widthof{$to$}]{$|$}}%
  10. }
  11. newcommand{sTO}{mathrel{texttt{=>}}}
  12. newcommand{sto}{mathrel{texttt{->}}}
  13. newcommand{slp}{mathopen{texttt{(}}}
  14. newcommand{srp}{mathopen{texttt{)}}}
  15. newcommand{slb}{mathopen{texttt{[}}}
  16. newcommand{srb}{mathopen{texttt{]}}}
  17. newcommand{slc}{mathpunct{texttt{,}}}
  18.  
  19. begin{document}
  20.  
  21. begin{figure}
  22. centering
  23.  
  24. footnotesize % adapt to your page size
  25. fbox{%
  26. $begin{aligned}
  27. mv{polytype} & to mv{context} sTO mv{monotype}
  28. && \
  29. & sor mv{monotype}
  30. && \[2ex]
  31. mv{monotype} & to mv{tyvar}
  32. && text{Type variable} \
  33. & sor mv{monotype}_1 sto mv{monotype}_2
  34. && text{Function type} \
  35. & sor slbmv{monotype}srb
  36. && text{List type} \
  37. & sor slpmv{monotype}_1slcdotsslcmv{monotype}_nsrp
  38. quad (n=0text{ or }nge2)
  39. && text{Tuple type (incl. unit)} \
  40. & sor mv{tycon},mv{monotype}_1dotsmv{monotype}_n
  41. quad (nge0)
  42. && text{Constructed type} \[2ex]
  43. context & to slpmv{class}_1,mv{tyvar}_1slcdotsslcmv{class}_n,mv{tyvar}_nsrp
  44. end{aligned}$%
  45. }
  46.  
  47. caption{Abstract syntax of Haskell: types}
  48.  
  49. end{figure}
  50.  
  51. end{document}
Add Comment
Please, Sign In to add comment