A Peek into Pugs Internals #19

Pugs AST

data Exp
    = Noop
    | FunctionApplication Exp (Maybe Exp) [Exp]

    | Syntax String [Exp]

    | Statements Exp Exp
    | Value Val
    | Variable Var
This isn't really how write this, because we like to golf. "Annotation" is one variant of `Exp`, which contains an Ann and an Exp. `Ann` is another data type defined elsewhere, and haskell does not confuse a variant (called "constructor") with names of data types, so we abbreviate and write "Ann" in both places.
Copyright © 2006 Gaal Yahas