purescript-0.11.7: PureScript Programming Language Compiler

Safe HaskellNone
LanguageHaskell2010

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 TypeName) (ProperName ConstructorName) [Ident]

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

Accessor a PSString (Expr a)

A record property accessor

ObjectUpdate a (Expr a) [(PSString, 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 Source # 

Methods

fmap :: (a -> b) -> Expr a -> Expr b #

(<$) :: a -> Expr b -> Expr a #

Show a => Show (Expr a) Source # 

Methods

showsPrec :: Int -> Expr a -> ShowS #

show :: Expr a -> String #

showList :: [Expr a] -> ShowS #

data Bind a Source #

A let or module binding.

Constructors

NonRec a Ident (Expr a)

Non-recursive binding for a single value

Rec [((a, Ident), Expr a)]

Mutually recursive binding group for several values

Instances

Functor Bind Source # 

Methods

fmap :: (a -> b) -> Bind a -> Bind b #

(<$) :: a -> Bind b -> Bind a #

Show a => Show (Bind a) Source # 

Methods

showsPrec :: Int -> Bind a -> ShowS #

show :: Bind a -> String #

showList :: [Bind a] -> ShowS #

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

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