I want to typeset a piece of code containing line breaks. New lines should indent to a specified point in the previous line. Here is a monospaced example to illustrate what I mean. Notice how 'case' and 'of' line up below, as well as 'let' and 'in':
swap : forall a, b. Tuple a b -> Tuple b a
swap a b x = case x
of tuple a b y z. let x' = tuple b a z y
in x'
The code I want to typeset is not monospaced, so I can't just use a verbatim environment to get what I want. The actual LaTeX of the first line, for instance, is
\mathsf{swap} : \forall\alpha,\beta.\;\mathsf{Tuple}\;\alpha\;\beta\to\mathsf{Tuple}\;\beta\;\alpha
How can I align some text to a specific point in the previous line?


tabular? – cmhughes Feb 7 '12 at 22:03