giml-language-0.1.0.0: A purely functional programming language with emphasis on structural typing
Safe HaskellNone
LanguageHaskell2010

Language.Giml.Syntax.Ast

Description

Giml AST definition

Synopsis

Language definition

type Var = Text Source #

A variable name

data Pattern Source #

A pattern

Constructors

PWildcard

A catch all pattern

PVar Var

A variable capture pattern

PLit Lit

A literal pattern

PVariant (Variant (Maybe Pattern))

A variant pattern

POpenVariant (Variant Pattern)

An open variant pattern

PRecord (Record Pattern)

A record pattern

Instances

Instances details
Eq Pattern Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

(==) :: Pattern -> Pattern -> Bool #

(/=) :: Pattern -> Pattern -> Bool #

Data Pattern Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Pattern -> c Pattern #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Pattern #

toConstr :: Pattern -> Constr #

dataTypeOf :: Pattern -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Pattern) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Pattern) #

gmapT :: (forall b. Data b => b -> b) -> Pattern -> Pattern #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Pattern -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Pattern -> r #

gmapQ :: (forall d. Data d => d -> u) -> Pattern -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Pattern -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Pattern -> m Pattern #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Pattern -> m Pattern #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Pattern -> m Pattern #

Ord Pattern Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Show Pattern Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

data Lit Source #

A literal

Constructors

LInt Int

Integers

LFloat Float

Floating point numbers

LString Text

Strings

Instances

Instances details
Eq Lit Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

(==) :: Lit -> Lit -> Bool #

(/=) :: Lit -> Lit -> Bool #

Data Lit Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Lit -> c Lit #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Lit #

toConstr :: Lit -> Constr #

dataTypeOf :: Lit -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Lit) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Lit) #

gmapT :: (forall b. Data b => b -> b) -> Lit -> Lit #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Lit -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Lit -> r #

gmapQ :: (forall d. Data d => d -> u) -> Lit -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Lit -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Lit -> m Lit #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Lit -> m Lit #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Lit -> m Lit #

Ord Lit Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

compare :: Lit -> Lit -> Ordering #

(<) :: Lit -> Lit -> Bool #

(<=) :: Lit -> Lit -> Bool #

(>) :: Lit -> Lit -> Bool #

(>=) :: Lit -> Lit -> Bool #

max :: Lit -> Lit -> Lit #

min :: Lit -> Lit -> Lit #

Show Lit Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

showsPrec :: Int -> Lit -> ShowS #

show :: Lit -> String #

showList :: [Lit] -> ShowS #

data Expr a Source #

An expression

Constructors

EAnnotated a (Expr a)

Annotates the child expression with some annotation

ELit Lit

A Literal

EVar Var

A variable name

EFun [Maybe Var] (Expr a)

An anonymous function

EFunCall (Expr a) [Expr a]

A function call

EBlock (Block a)

A do block

ELet (TermDef a) (Expr a)

A let expression

EVariant Constr

A variant (or data constructor)

EOpenVariant Constr

An open variant

ERecord (Record (Expr a))

A record

ERecordAccess (Expr a) Label

Record access to a specific label

ERecordExtension (Record (Expr a)) (Expr a)

Extends a record

EIf (Expr a) (Expr a) (Expr a)

A 2-way if expression

ECase (Expr a) [(Pattern, Expr a)]

A case expression (pattern matching)

EFfi Text (Maybe Type) [Expr a]

A foreign function interface call

Instances

Instances details
Functor Expr Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

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

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

Foldable Expr Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

fold :: Monoid m => Expr m -> m #

foldMap :: Monoid m => (a -> m) -> Expr a -> m #

foldMap' :: Monoid m => (a -> m) -> Expr a -> m #

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

foldr' :: (a -> b -> b) -> b -> Expr a -> b #

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

foldl' :: (b -> a -> b) -> b -> Expr a -> b #

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

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

toList :: Expr a -> [a] #

null :: Expr a -> Bool #

length :: Expr a -> Int #

elem :: Eq a => a -> Expr a -> Bool #

maximum :: Ord a => Expr a -> a #

minimum :: Ord a => Expr a -> a #

sum :: Num a => Expr a -> a #

product :: Num a => Expr a -> a #

Traversable Expr Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

traverse :: Applicative f => (a -> f b) -> Expr a -> f (Expr b) #

sequenceA :: Applicative f => Expr (f a) -> f (Expr a) #

mapM :: Monad m => (a -> m b) -> Expr a -> m (Expr b) #

sequence :: Monad m => Expr (m a) -> m (Expr a) #

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

Defined in Language.Giml.Syntax.Ast

Methods

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

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

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

Defined in Language.Giml.Syntax.Ast

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Expr a -> c (Expr a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Expr a) #

toConstr :: Expr a -> Constr #

dataTypeOf :: Expr a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Expr a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Expr a)) #

gmapT :: (forall b. Data b => b -> b) -> Expr a -> Expr a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Expr a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Expr a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Expr a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Expr a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Expr a -> m (Expr a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Expr a -> m (Expr a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Expr a -> m (Expr a) #

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

Defined in Language.Giml.Syntax.Ast

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 #

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

Defined in Language.Giml.Syntax.Ast

Methods

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

show :: Expr a -> String #

showList :: [Expr a] -> ShowS #

data Statement a Source #

A Statement

Constructors

SExpr a (Expr a)

An expression

SDef a (TermDef a)

A term definition

SBind a Var (Expr a)

A bind statement

Instances

Instances details
Functor Statement Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

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

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

Foldable Statement Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

fold :: Monoid m => Statement m -> m #

foldMap :: Monoid m => (a -> m) -> Statement a -> m #

foldMap' :: Monoid m => (a -> m) -> Statement a -> m #

foldr :: (a -> b -> b) -> b -> Statement a -> b #

foldr' :: (a -> b -> b) -> b -> Statement a -> b #

foldl :: (b -> a -> b) -> b -> Statement a -> b #

foldl' :: (b -> a -> b) -> b -> Statement a -> b #

foldr1 :: (a -> a -> a) -> Statement a -> a #

foldl1 :: (a -> a -> a) -> Statement a -> a #

toList :: Statement a -> [a] #

null :: Statement a -> Bool #

length :: Statement a -> Int #

elem :: Eq a => a -> Statement a -> Bool #

maximum :: Ord a => Statement a -> a #

minimum :: Ord a => Statement a -> a #

sum :: Num a => Statement a -> a #

product :: Num a => Statement a -> a #

Traversable Statement Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

traverse :: Applicative f => (a -> f b) -> Statement a -> f (Statement b) #

sequenceA :: Applicative f => Statement (f a) -> f (Statement a) #

mapM :: Monad m => (a -> m b) -> Statement a -> m (Statement b) #

sequence :: Monad m => Statement (m a) -> m (Statement a) #

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

Defined in Language.Giml.Syntax.Ast

Methods

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

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

Data a => Data (Statement a) Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Statement a -> c (Statement a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Statement a) #

toConstr :: Statement a -> Constr #

dataTypeOf :: Statement a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Statement a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Statement a)) #

gmapT :: (forall b. Data b => b -> b) -> Statement a -> Statement a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Statement a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Statement a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Statement a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Statement a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Statement a -> m (Statement a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Statement a -> m (Statement a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Statement a -> m (Statement a) #

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

Defined in Language.Giml.Syntax.Ast

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

Defined in Language.Giml.Syntax.Ast

data Datatype a Source #

A data type definition

Constructors

Datatype a Constr [TypeVar] [Variant (Maybe Type)] 

Instances

Instances details
Functor Datatype Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

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

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

Foldable Datatype Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

fold :: Monoid m => Datatype m -> m #

foldMap :: Monoid m => (a -> m) -> Datatype a -> m #

foldMap' :: Monoid m => (a -> m) -> Datatype a -> m #

foldr :: (a -> b -> b) -> b -> Datatype a -> b #

foldr' :: (a -> b -> b) -> b -> Datatype a -> b #

foldl :: (b -> a -> b) -> b -> Datatype a -> b #

foldl' :: (b -> a -> b) -> b -> Datatype a -> b #

foldr1 :: (a -> a -> a) -> Datatype a -> a #

foldl1 :: (a -> a -> a) -> Datatype a -> a #

toList :: Datatype a -> [a] #

null :: Datatype a -> Bool #

length :: Datatype a -> Int #

elem :: Eq a => a -> Datatype a -> Bool #

maximum :: Ord a => Datatype a -> a #

minimum :: Ord a => Datatype a -> a #

sum :: Num a => Datatype a -> a #

product :: Num a => Datatype a -> a #

Traversable Datatype Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

traverse :: Applicative f => (a -> f b) -> Datatype a -> f (Datatype b) #

sequenceA :: Applicative f => Datatype (f a) -> f (Datatype a) #

mapM :: Monad m => (a -> m b) -> Datatype a -> m (Datatype b) #

sequence :: Monad m => Datatype (m a) -> m (Datatype a) #

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

Defined in Language.Giml.Syntax.Ast

Methods

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

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

Data a => Data (Datatype a) Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Datatype a -> c (Datatype a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Datatype a) #

toConstr :: Datatype a -> Constr #

dataTypeOf :: Datatype a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Datatype a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Datatype a)) #

gmapT :: (forall b. Data b => b -> b) -> Datatype a -> Datatype a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Datatype a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Datatype a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Datatype a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Datatype a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Datatype a -> m (Datatype a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Datatype a -> m (Datatype a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Datatype a -> m (Datatype a) #

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

Defined in Language.Giml.Syntax.Ast

Methods

compare :: Datatype a -> Datatype a -> Ordering #

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

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

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

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

max :: Datatype a -> Datatype a -> Datatype a #

min :: Datatype a -> Datatype a -> Datatype a #

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

Defined in Language.Giml.Syntax.Ast

Methods

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

show :: Datatype a -> String #

showList :: [Datatype a] -> ShowS #

type Block a = [Statement a] Source #

A Block is a list of statements

data TermDef a Source #

A term definition

Constructors

Variable a Var (Expr a)

A variable

Function a Var [Maybe Var] (Expr a)

A function

Instances

Instances details
Functor TermDef Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

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

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

Foldable TermDef Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

fold :: Monoid m => TermDef m -> m #

foldMap :: Monoid m => (a -> m) -> TermDef a -> m #

foldMap' :: Monoid m => (a -> m) -> TermDef a -> m #

foldr :: (a -> b -> b) -> b -> TermDef a -> b #

foldr' :: (a -> b -> b) -> b -> TermDef a -> b #

foldl :: (b -> a -> b) -> b -> TermDef a -> b #

foldl' :: (b -> a -> b) -> b -> TermDef a -> b #

foldr1 :: (a -> a -> a) -> TermDef a -> a #

foldl1 :: (a -> a -> a) -> TermDef a -> a #

toList :: TermDef a -> [a] #

null :: TermDef a -> Bool #

length :: TermDef a -> Int #

elem :: Eq a => a -> TermDef a -> Bool #

maximum :: Ord a => TermDef a -> a #

minimum :: Ord a => TermDef a -> a #

sum :: Num a => TermDef a -> a #

product :: Num a => TermDef a -> a #

Traversable TermDef Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

traverse :: Applicative f => (a -> f b) -> TermDef a -> f (TermDef b) #

sequenceA :: Applicative f => TermDef (f a) -> f (TermDef a) #

mapM :: Monad m => (a -> m b) -> TermDef a -> m (TermDef b) #

sequence :: Monad m => TermDef (m a) -> m (TermDef a) #

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

Defined in Language.Giml.Syntax.Ast

Methods

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

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

Data a => Data (TermDef a) Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TermDef a -> c (TermDef a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (TermDef a) #

toConstr :: TermDef a -> Constr #

dataTypeOf :: TermDef a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (TermDef a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (TermDef a)) #

gmapT :: (forall b. Data b => b -> b) -> TermDef a -> TermDef a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TermDef a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TermDef a -> r #

gmapQ :: (forall d. Data d => d -> u) -> TermDef a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> TermDef a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> TermDef a -> m (TermDef a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TermDef a -> m (TermDef a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TermDef a -> m (TermDef a) #

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

Defined in Language.Giml.Syntax.Ast

Methods

compare :: TermDef a -> TermDef a -> Ordering #

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

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

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

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

max :: TermDef a -> TermDef a -> TermDef a #

min :: TermDef a -> TermDef a -> TermDef a #

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

Defined in Language.Giml.Syntax.Ast

Methods

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

show :: TermDef a -> String #

showList :: [TermDef a] -> ShowS #

data Definition a Source #

A top level definition

Constructors

TypeDef (Datatype a)

A type definition

TermDef (TermDef a)

A term definition

Instances

Instances details
Functor Definition Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

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

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

Foldable Definition Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

fold :: Monoid m => Definition m -> m #

foldMap :: Monoid m => (a -> m) -> Definition a -> m #

foldMap' :: Monoid m => (a -> m) -> Definition a -> m #

foldr :: (a -> b -> b) -> b -> Definition a -> b #

foldr' :: (a -> b -> b) -> b -> Definition a -> b #

foldl :: (b -> a -> b) -> b -> Definition a -> b #

foldl' :: (b -> a -> b) -> b -> Definition a -> b #

foldr1 :: (a -> a -> a) -> Definition a -> a #

foldl1 :: (a -> a -> a) -> Definition a -> a #

toList :: Definition a -> [a] #

null :: Definition a -> Bool #

length :: Definition a -> Int #

elem :: Eq a => a -> Definition a -> Bool #

maximum :: Ord a => Definition a -> a #

minimum :: Ord a => Definition a -> a #

sum :: Num a => Definition a -> a #

product :: Num a => Definition a -> a #

Traversable Definition Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

traverse :: Applicative f => (a -> f b) -> Definition a -> f (Definition b) #

sequenceA :: Applicative f => Definition (f a) -> f (Definition a) #

mapM :: Monad m => (a -> m b) -> Definition a -> m (Definition b) #

sequence :: Monad m => Definition (m a) -> m (Definition a) #

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

Defined in Language.Giml.Syntax.Ast

Methods

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

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

Data a => Data (Definition a) Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Definition a -> c (Definition a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Definition a) #

toConstr :: Definition a -> Constr #

dataTypeOf :: Definition a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Definition a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Definition a)) #

gmapT :: (forall b. Data b => b -> b) -> Definition a -> Definition a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Definition a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Definition a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Definition a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Definition a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Definition a -> m (Definition a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Definition a -> m (Definition a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Definition a -> m (Definition a) #

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

Defined in Language.Giml.Syntax.Ast

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

Defined in Language.Giml.Syntax.Ast

data File a Source #

The type of a source file after ordering and grouping

Constructors

File [Datatype a] [[TermDef a]] 

Instances

Instances details
Functor File Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

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

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

Foldable File Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

fold :: Monoid m => File m -> m #

foldMap :: Monoid m => (a -> m) -> File a -> m #

foldMap' :: Monoid m => (a -> m) -> File a -> m #

foldr :: (a -> b -> b) -> b -> File a -> b #

foldr' :: (a -> b -> b) -> b -> File a -> b #

foldl :: (b -> a -> b) -> b -> File a -> b #

foldl' :: (b -> a -> b) -> b -> File a -> b #

foldr1 :: (a -> a -> a) -> File a -> a #

foldl1 :: (a -> a -> a) -> File a -> a #

toList :: File a -> [a] #

null :: File a -> Bool #

length :: File a -> Int #

elem :: Eq a => a -> File a -> Bool #

maximum :: Ord a => File a -> a #

minimum :: Ord a => File a -> a #

sum :: Num a => File a -> a #

product :: Num a => File a -> a #

Traversable File Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

traverse :: Applicative f => (a -> f b) -> File a -> f (File b) #

sequenceA :: Applicative f => File (f a) -> f (File a) #

mapM :: Monad m => (a -> m b) -> File a -> m (File b) #

sequence :: Monad m => File (m a) -> m (File a) #

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

Defined in Language.Giml.Syntax.Ast

Methods

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

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

Data a => Data (File a) Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> File a -> c (File a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (File a) #

toConstr :: File a -> Constr #

dataTypeOf :: File a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (File a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (File a)) #

gmapT :: (forall b. Data b => b -> b) -> File a -> File a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> File a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> File a -> r #

gmapQ :: (forall d. Data d => d -> u) -> File a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> File a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> File a -> m (File a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> File a -> m (File a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> File a -> m (File a) #

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

Defined in Language.Giml.Syntax.Ast

Methods

compare :: File a -> File a -> Ordering #

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

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

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

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

max :: File a -> File a -> File a #

min :: File a -> File a -> File a #

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

Defined in Language.Giml.Syntax.Ast

Methods

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

show :: File a -> String #

showList :: [File a] -> ShowS #

data ParsedFile a Source #

The type of a source file as seen by the parser

Constructors

ParsedFile [Definition a] 

Instances

Instances details
Functor ParsedFile Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

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

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

Foldable ParsedFile Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

fold :: Monoid m => ParsedFile m -> m #

foldMap :: Monoid m => (a -> m) -> ParsedFile a -> m #

foldMap' :: Monoid m => (a -> m) -> ParsedFile a -> m #

foldr :: (a -> b -> b) -> b -> ParsedFile a -> b #

foldr' :: (a -> b -> b) -> b -> ParsedFile a -> b #

foldl :: (b -> a -> b) -> b -> ParsedFile a -> b #

foldl' :: (b -> a -> b) -> b -> ParsedFile a -> b #

foldr1 :: (a -> a -> a) -> ParsedFile a -> a #

foldl1 :: (a -> a -> a) -> ParsedFile a -> a #

toList :: ParsedFile a -> [a] #

null :: ParsedFile a -> Bool #

length :: ParsedFile a -> Int #

elem :: Eq a => a -> ParsedFile a -> Bool #

maximum :: Ord a => ParsedFile a -> a #

minimum :: Ord a => ParsedFile a -> a #

sum :: Num a => ParsedFile a -> a #

product :: Num a => ParsedFile a -> a #

Traversable ParsedFile Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

traverse :: Applicative f => (a -> f b) -> ParsedFile a -> f (ParsedFile b) #

sequenceA :: Applicative f => ParsedFile (f a) -> f (ParsedFile a) #

mapM :: Monad m => (a -> m b) -> ParsedFile a -> m (ParsedFile b) #

sequence :: Monad m => ParsedFile (m a) -> m (ParsedFile a) #

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

Defined in Language.Giml.Syntax.Ast

Methods

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

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

Data a => Data (ParsedFile a) Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ParsedFile a -> c (ParsedFile a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (ParsedFile a) #

toConstr :: ParsedFile a -> Constr #

dataTypeOf :: ParsedFile a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (ParsedFile a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ParsedFile a)) #

gmapT :: (forall b. Data b => b -> b) -> ParsedFile a -> ParsedFile a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ParsedFile a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ParsedFile a -> r #

gmapQ :: (forall d. Data d => d -> u) -> ParsedFile a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ParsedFile a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ParsedFile a -> m (ParsedFile a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ParsedFile a -> m (ParsedFile a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ParsedFile a -> m (ParsedFile a) #

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

Defined in Language.Giml.Syntax.Ast

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

Defined in Language.Giml.Syntax.Ast

mkERec :: [(Label, Expr a)] -> Maybe (Expr a) -> Expr a Source #

Create a record expression (or extension) from a a list of (label, expression) and a expression to extend (if needed).

Note that this function is left-biased - duplicate fields will preserve the first field.

efun :: [Var] -> Expr a -> Expr a Source #

A lambda without wildcards

getTermDef :: Definition ann -> Maybe (TermDef ann) Source #

Extract a term definition and annotation.

getTermName :: TermDef a -> Var Source #

Get the name of a term definition.

getDefName :: Definition ann -> Text Source #

Get definition name

getTypeDef :: Definition ann -> Maybe (Datatype ann) Source #

Extract a type definition and annotation.

getTermAnn :: TermDef ann -> ann Source #

Get the name of a term definition.

setTermAnn :: a -> TermDef a -> TermDef a Source #

Set the annotation of a term definition.

getTypeName :: Datatype ann -> Constr Source #

Get the name of a datatype definition.

getTypeAnn :: Datatype ann -> ann Source #

Get the annotation of a datatype definition.

setTypeAnn :: b -> Datatype a -> Datatype b Source #

Set the annotation of a datatype definition.

getExprAnn :: Show a => Expr a -> a Source #

Retrieve the annotation of an expression. Will explode when used on a non EAnnotated node.

Common data types

Giml types