giml-syntax-0.1.0.0: Syntax for Giml - A purely functional programming language with emphasis on structural typing
Safe HaskellSafe-Inferred
LanguageGHC2021

Language.Giml.Syntax.Ast

Description

Giml AST definition

Synopsis

Language definition

data OpFixity Source #

Define the associativity of the operator

Constructors

InfixLeft 
InfixRight 
Infix 

Instances

Instances details
Data OpFixity 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) -> OpFixity -> c OpFixity #

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

toConstr :: OpFixity -> Constr #

dataTypeOf :: OpFixity -> DataType #

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

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

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

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

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

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

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

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

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

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

Show OpFixity Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Eq OpFixity Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Ord OpFixity Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

data OpDef Source #

Operator definition

Constructors

OpDef 

Instances

Instances details
Data OpDef 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) -> OpDef -> c OpDef #

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

toConstr :: OpDef -> Constr #

dataTypeOf :: OpDef -> DataType #

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

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

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

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

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

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

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

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

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

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

Show OpDef Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

showsPrec :: Int -> OpDef -> ShowS #

show :: OpDef -> String #

showList :: [OpDef] -> ShowS #

Eq OpDef Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

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

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

Ord OpDef Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

compare :: OpDef -> OpDef -> Ordering #

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

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

(>) :: OpDef -> OpDef -> Bool #

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

max :: OpDef -> OpDef -> OpDef #

min :: OpDef -> OpDef -> OpDef #

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
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 #

Show Pattern Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Eq Pattern Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

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

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

Ord Pattern Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

data Lit Source #

A literal

Constructors

LBool Bool

Booleans

LInt Int32

Integers

LFloat Float

Floating point numbers

LString Text

Strings

Instances

Instances details
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 #

Show Lit Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

showsPrec :: Int -> Lit -> ShowS #

show :: Lit -> String #

showList :: [Lit] -> ShowS #

Eq Lit Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

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

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

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 #

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

EOp OpDef

An operator

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
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) #

Functor Expr Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

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

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

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) #

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 #

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 #

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 #

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
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) #

Functor Statement Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

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

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

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) #

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

Defined in Language.Giml.Syntax.Ast

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 #

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

Defined in Language.Giml.Syntax.Ast

data Datatype a Source #

A data type definition

Instances

Instances details
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) #

Functor Datatype Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

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

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

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) #

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 #

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 #

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 #

type Block a = [Statement a] Source #

A Block is a list of statements

data TermDef a Source #

A term definition

Constructors

Variable a Var (Maybe Type) (Expr a)

A variable

Function a Var (Maybe Type) [Maybe Var] (Expr a)

A function | Operator a OpDef -- ^ An operator definition

Instances

Instances details
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) #

Functor TermDef Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

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

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

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) #

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 #

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 #

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 #

data Definition a Source #

A top level definition

Constructors

TypeDef (Datatype a)

A type definition

TermDef (TermDef a)

A term definition

Instances

Instances details
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) #

Functor Definition Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

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

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

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) #

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

Defined in Language.Giml.Syntax.Ast

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 #

Ord a => Ord (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
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) #

Functor File Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

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

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

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) #

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 #

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 #

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 #

data ParsedFile a Source #

The type of a source file as seen by the parser

Constructors

ParsedFile [Definition a] 

Instances

Instances details
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) #

Functor ParsedFile Source # 
Instance details

Defined in Language.Giml.Syntax.Ast

Methods

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

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

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) #

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

Defined in Language.Giml.Syntax.Ast

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 #

Ord a => Ord (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 -> TypeCon 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