purescript-0.7.0.0: PureScript Programming Language Compiler

Safe HaskellNone
LanguageHaskell98

Language.PureScript.CoreFn.Expr

Description

The core functional representation

Synopsis

Documentation

data Expr a Source

Data type for expressions and terms

Constructors

Literal a (Literal (Expr a))

A literal value

Constructor a ProperName ProperName [Ident]

A data constructor (type name, constructor name, field names)

Accessor a String (Expr a)

A record property accessor

ObjectUpdate a (Expr a) [(String, Expr a)]

Partial record update

Abs a Ident (Expr a)

Function introduction

App a (Expr a) (Expr a)

Function application

Var a (Qualified Ident)

Variable

Case a [Expr a] [CaseAlternative a]

A case expression

Let a [Bind a] (Expr a)

A let binding

Instances

Functor Expr 
Data a => Data (Expr a) 
Show a => Show (Expr a) 
Typeable (* -> *) Expr 

data Bind a Source

A let or module binding.

Constructors

NonRec Ident (Expr a)

Non-recursive binding for a single value

Rec [(Ident, Expr a)]

Mutually recursive binding group for several values

Instances

Functor Bind 
Data a => Data (Bind a) 
Show a => Show (Bind a) 
Typeable (* -> *) Bind 

type Guard a = Expr a Source

A guard is just a boolean-valued expression that appears alongside a set of binders

data CaseAlternative a Source

An alternative in a case statement

Constructors

CaseAlternative 

Fields

caseAlternativeBinders :: [Binder a]

A collection of binders with which to match the inputs

caseAlternativeResult :: Either [(Guard a, Expr a)] (Expr a)

The result expression or a collect of guarded expressions

extractAnn :: Expr a -> a Source

Extract the annotation from a term

modifyAnn :: (a -> a) -> Expr a -> Expr a Source

Modify the annotation on a term