Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass[a4paper]{article}
- usepackage{amsmath}
- usepackage{calc}
- newcommand{mv}[1]{% metavariable
- mathit{#1}%
- }
- newcommand{sor}{% syntax or
- mathrel{makebox[widthof{$to$}]{$|$}}%
- }
- newcommand{sTO}{mathrel{texttt{=>}}}
- newcommand{sto}{mathrel{texttt{->}}}
- newcommand{slp}{mathopen{texttt{(}}}
- newcommand{srp}{mathopen{texttt{)}}}
- newcommand{slb}{mathopen{texttt{[}}}
- newcommand{srb}{mathopen{texttt{]}}}
- newcommand{slc}{mathpunct{texttt{,}}}
- begin{document}
- begin{figure}
- centering
- footnotesize % adapt to your page size
- fbox{%
- $begin{aligned}
- mv{polytype} & to mv{context} sTO mv{monotype}
- && \
- & sor mv{monotype}
- && \[2ex]
- mv{monotype} & to mv{tyvar}
- && text{Type variable} \
- & sor mv{monotype}_1 sto mv{monotype}_2
- && text{Function type} \
- & sor slbmv{monotype}srb
- && text{List type} \
- & sor slpmv{monotype}_1slcdotsslcmv{monotype}_nsrp
- quad (n=0text{ or }nge2)
- && text{Tuple type (incl. unit)} \
- & sor mv{tycon},mv{monotype}_1dotsmv{monotype}_n
- quad (nge0)
- && text{Constructed type} \[2ex]
- context & to slpmv{class}_1,mv{tyvar}_1slcdotsslcmv{class}_n,mv{tyvar}_nsrp
- end{aligned}$%
- }
- caption{Abstract syntax of Haskell: types}
- end{figure}
- end{document}
Add Comment
Please, Sign In to add comment