purescript-0.15.9: PureScript Programming Language Compiler
Safe HaskellSafe-Inferred
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

Instances details
Functor Expr Source # 
Instance details

Defined in Language.PureScript.CoreFn.Expr

Methods

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

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

Show a => Show (Expr a) Source # 
Instance details

Defined in Language.PureScript.CoreFn.Expr

Methods

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

show :: Expr a -> String #

showList :: [Expr a] -> ShowS #

Eq a => Eq (Expr a) Source # 
Instance details

Defined in Language.PureScript.CoreFn.Expr

Methods

(==) :: Expr a -> Expr a -> Bool #

(/=) :: Expr a -> Expr a -> Bool #

Ord a => Ord (Expr a) Source # 
Instance details

Defined in Language.PureScript.CoreFn.Expr

Methods

compare :: Expr a -> Expr a -> Ordering #

(<) :: Expr a -> Expr a -> Bool #

(<=) :: Expr a -> Expr a -> Bool #

(>) :: Expr a -> Expr a -> Bool #

(>=) :: Expr a -> Expr a -> Bool #

max :: Expr a -> Expr a -> Expr a #

min :: Expr a -> Expr a -> Expr a #

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

Instances details
Functor Bind Source # 
Instance details

Defined in Language.PureScript.CoreFn.Expr

Methods

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

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

Show a => Show (Bind a) Source # 
Instance details

Defined in Language.PureScript.CoreFn.Expr

Methods

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

show :: Bind a -> String #

showList :: [Bind a] -> ShowS #

Eq a => Eq (Bind a) Source # 
Instance details

Defined in Language.PureScript.CoreFn.Expr

Methods

(==) :: Bind a -> Bind a -> Bool #

(/=) :: Bind a -> Bind a -> Bool #

Ord a => Ord (Bind a) Source # 
Instance details

Defined in Language.PureScript.CoreFn.Expr

Methods

compare :: Bind a -> Bind a -> Ordering #

(<) :: Bind a -> Bind a -> Bool #

(<=) :: Bind a -> Bind a -> Bool #

(>) :: Bind a -> Bind a -> Bool #

(>=) :: Bind a -> Bind a -> Bool #

max :: Bind a -> Bind a -> Bind a #

min :: Bind a -> Bind a -> Bind a #

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