module AST.Expression.Source where
import AST.PrettyPrint
import Text.PrettyPrint as P
import qualified AST.Expression.General as General
import AST.Type (RawType)
import qualified AST.Variable as Var
import qualified AST.Annotation as Annotation
import qualified AST.Pattern as Pattern
type Expr =
General.Expr Annotation.Region Def Var.Raw
type Expr' =
General.Expr' Annotation.Region Def Var.Raw
data Def
= Definition Pattern.RawPattern Expr
| TypeAnnotation String RawType
deriving (Show)
instance Pretty Def where
pretty def =
case def of
TypeAnnotation name tipe ->
variable name <+> P.colon <+> pretty tipe
Definition pattern expr ->
pretty pattern <+> P.equals <+> pretty expr