Copyright | (c) Henry J. Wylde, 2015 |
---|---|
License | BSD3 |
Maintainer | public@hjwylde.com |
Safe Haskell | Safe |
Language | Haskell2010 |
Abstract syntax tree nodes with annotations.
The annotation style was inspired by haskell-src-exts.
- class Annotated node where
- ann :: node a -> a
- data Id a = Id a String
- data Program a = Program a [Decl a]
- data Decl a = FunctionDecl a (Id a) [(Type a, Id a)] [Stmt a]
- name :: Decl a -> Id a
- parameters :: Decl a -> [(Type a, Id a)]
- parameterNames :: Decl a -> [Id a]
- parameterTypes :: Decl a -> [Type a]
- returnType :: Decl a -> Type a
- stmts :: Decl a -> [Stmt a]
- data Stmt a
- data Expr a
- data Type a
- data BinaryOp
- data UnaryOp
- data Value
Type class
Annotated nodes
An identifier.
A program is a list of declarations.
A declaration.
parameters :: Decl a -> [(Type a, Id a)] Source
parameterNames :: Decl a -> [Id a] Source
parameterTypes :: Decl a -> [Type a] Source
returnType :: Decl a -> Type a Source
A statement.
A complex expression.
A type.
Regular nodes
A binary operator.