Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Giml AST definition
Synopsis
- data OpFixity
- = InfixLeft
- | InfixRight
- | Infix
- data OpDef = OpDef {}
- type Var = Text
- data Pattern
- data Lit
- data Expr a
- = EAnnotated a (Expr a)
- | ELit Lit
- | EVar Var
- | EFun [Maybe Var] (Expr a)
- | EOp OpDef
- | EFunCall (Expr a) [Expr a]
- | EBlock (Block a)
- | ELet (TermDef a) (Expr a)
- | EVariant Constr
- | EOpenVariant Constr
- | ERecord (Record (Expr a))
- | ERecordAccess (Expr a) Label
- | ERecordExtension (Record (Expr a)) (Expr a)
- | EIf (Expr a) (Expr a) (Expr a)
- | ECase (Expr a) [(Pattern, Expr a)]
- | EFfi Text (Maybe Type) [Expr a]
- data Statement a
- data Datatype a = Datatype a TypeCon (Maybe Kind) [TypeVar] [Variant (Maybe Type)]
- type Block a = [Statement a]
- data TermDef a
- data Definition a
- data File a = File [Datatype a] [[TermDef a]]
- data ParsedFile a = ParsedFile [Definition a]
- mkERec :: [(Label, Expr a)] -> Maybe (Expr a) -> Expr a
- efun :: [Var] -> Expr a -> Expr a
- getTermDef :: Definition ann -> Maybe (TermDef ann)
- getTermName :: TermDef a -> Var
- getDefName :: Definition ann -> Text
- getTypeDef :: Definition ann -> Maybe (Datatype ann)
- getTermAnn :: TermDef ann -> ann
- setTermAnn :: a -> TermDef a -> TermDef a
- getTypeName :: Datatype ann -> TypeCon
- getTypeAnn :: Datatype ann -> ann
- setTypeAnn :: b -> Datatype a -> Datatype b
- getExprAnn :: Show a => Expr a -> a
- module Language.Giml.Common
- module Language.Giml.Syntax.Types
Language definition
Define the associativity of the operator
Instances
Data OpFixity Source # | |
Defined in Language.Giml.Syntax.Ast 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 # | |
Eq OpFixity Source # | |
Ord OpFixity Source # | |
Defined in Language.Giml.Syntax.Ast |
Operator definition
Instances
Data OpDef Source # | |
Defined in Language.Giml.Syntax.Ast 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 # 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 # | |
Eq OpDef Source # | |
Ord OpDef Source # | |
A pattern
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
Data Pattern Source # | |
Defined in Language.Giml.Syntax.Ast 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 # | |
Eq Pattern Source # | |
Ord Pattern Source # | |
A literal
Instances
Data Lit Source # | |
Defined in Language.Giml.Syntax.Ast 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 # 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 # | |
Eq Lit Source # | |
Ord Lit Source # | |
An expression
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
Foldable Expr Source # | |
Defined in Language.Giml.Syntax.Ast 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 # elem :: Eq a => a -> Expr a -> Bool # maximum :: Ord a => Expr a -> a # | |
Traversable Expr Source # | |
Functor Expr Source # | |
Data a => Data (Expr a) Source # | |
Defined in Language.Giml.Syntax.Ast 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 # | |
Eq a => Eq (Expr a) Source # | |
Ord a => Ord (Expr a) Source # | |
A Statement
SExpr a (Expr a) | An expression |
SDef a (TermDef a) | A term definition |
SBind a Var (Expr a) | A bind statement |
Instances
Foldable Statement Source # | |
Defined in Language.Giml.Syntax.Ast 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] # length :: Statement a -> Int # elem :: Eq a => a -> Statement a -> Bool # maximum :: Ord a => Statement a -> a # minimum :: Ord a => Statement a -> a # | |
Traversable Statement Source # | |
Defined in Language.Giml.Syntax.Ast | |
Functor Statement Source # | |
Data a => Data (Statement a) Source # | |
Defined in Language.Giml.Syntax.Ast 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 # | |
Eq a => Eq (Statement a) Source # | |
Ord a => Ord (Statement a) Source # | |
Defined in Language.Giml.Syntax.Ast |
A data type definition
Instances
Foldable Datatype Source # | |
Defined in Language.Giml.Syntax.Ast 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 # elem :: Eq a => a -> Datatype a -> Bool # maximum :: Ord a => Datatype a -> a # minimum :: Ord a => Datatype a -> a # | |
Traversable Datatype Source # | |
Functor Datatype Source # | |
Data a => Data (Datatype a) Source # | |
Defined in Language.Giml.Syntax.Ast 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 # | |
Eq a => Eq (Datatype a) Source # | |
Ord a => Ord (Datatype a) Source # | |
A term definition
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
Foldable TermDef Source # | |
Defined in Language.Giml.Syntax.Ast 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 # elem :: Eq a => a -> TermDef a -> Bool # maximum :: Ord a => TermDef a -> a # minimum :: Ord a => TermDef a -> a # | |
Traversable TermDef Source # | |
Functor TermDef Source # | |
Data a => Data (TermDef a) Source # | |
Defined in Language.Giml.Syntax.Ast 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 # | |
Eq a => Eq (TermDef a) Source # | |
Ord a => Ord (TermDef a) Source # | |
Defined in Language.Giml.Syntax.Ast |
data Definition a Source #
A top level definition
Instances
Foldable Definition Source # | |
Defined in Language.Giml.Syntax.Ast 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 # | |
Defined in Language.Giml.Syntax.Ast 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 # | |
Defined in Language.Giml.Syntax.Ast fmap :: (a -> b) -> Definition a -> Definition b # (<$) :: a -> Definition b -> Definition a # | |
Data a => Data (Definition a) Source # | |
Defined in Language.Giml.Syntax.Ast 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 # | |
Defined in Language.Giml.Syntax.Ast showsPrec :: Int -> Definition a -> ShowS # show :: Definition a -> String # showList :: [Definition a] -> ShowS # | |
Eq a => Eq (Definition a) Source # | |
Defined in Language.Giml.Syntax.Ast (==) :: Definition a -> Definition a -> Bool # (/=) :: Definition a -> Definition a -> Bool # | |
Ord a => Ord (Definition a) Source # | |
Defined in Language.Giml.Syntax.Ast compare :: Definition a -> Definition a -> Ordering # (<) :: Definition a -> Definition a -> Bool # (<=) :: Definition a -> Definition a -> Bool # (>) :: Definition a -> Definition a -> Bool # (>=) :: Definition a -> Definition a -> Bool # max :: Definition a -> Definition a -> Definition a # min :: Definition a -> Definition a -> Definition a # |
The type of a source file after ordering and grouping
Instances
Foldable File Source # | |
Defined in Language.Giml.Syntax.Ast 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 # elem :: Eq a => a -> File a -> Bool # maximum :: Ord a => File a -> a # | |
Traversable File Source # | |
Functor File Source # | |
Data a => Data (File a) Source # | |
Defined in Language.Giml.Syntax.Ast 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 # | |
Eq a => Eq (File a) Source # | |
Ord a => Ord (File a) Source # | |
data ParsedFile a Source #
The type of a source file as seen by the parser
ParsedFile [Definition a] |
Instances
Foldable ParsedFile Source # | |
Defined in Language.Giml.Syntax.Ast 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 # | |
Defined in Language.Giml.Syntax.Ast 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 # | |
Defined in Language.Giml.Syntax.Ast fmap :: (a -> b) -> ParsedFile a -> ParsedFile b # (<$) :: a -> ParsedFile b -> ParsedFile a # | |
Data a => Data (ParsedFile a) Source # | |
Defined in Language.Giml.Syntax.Ast 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 # | |
Defined in Language.Giml.Syntax.Ast showsPrec :: Int -> ParsedFile a -> ShowS # show :: ParsedFile a -> String # showList :: [ParsedFile a] -> ShowS # | |
Eq a => Eq (ParsedFile a) Source # | |
Defined in Language.Giml.Syntax.Ast (==) :: ParsedFile a -> ParsedFile a -> Bool # (/=) :: ParsedFile a -> ParsedFile a -> Bool # | |
Ord a => Ord (ParsedFile a) Source # | |
Defined in Language.Giml.Syntax.Ast compare :: ParsedFile a -> ParsedFile a -> Ordering # (<) :: ParsedFile a -> ParsedFile a -> Bool # (<=) :: ParsedFile a -> ParsedFile a -> Bool # (>) :: ParsedFile a -> ParsedFile a -> Bool # (>=) :: ParsedFile a -> ParsedFile a -> Bool # max :: ParsedFile a -> ParsedFile a -> ParsedFile a # min :: ParsedFile a -> ParsedFile a -> ParsedFile a # |
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.
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
module Language.Giml.Common
Giml types
module Language.Giml.Syntax.Types