Copyright | Brent Yorgey |
---|---|
License | BSD-3-Clause |
Maintainer | byorgey@gmail.com |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
A Module
packages together a type-annotated syntax tree along
with a context of top-level definitions.
Modules
A module generally represents the result of performing type
inference on a top-level expression, which in particular can
contain definitions (TDef
). A module
contains the type-annotated AST of the expression itself, as well
as the context giving the types of any defined variables.
Instances
HasBindings UModule Source # | |
Defined in Swarm.Language.Typecheck | |
Functor (Module s) Source # | |
(FromJSON s, FromJSON t) => FromJSON (Module s t) Source # | |
(ToJSON t, ToJSON s) => ToJSON (Module s t) Source # | |
Defined in Swarm.Language.Module | |
(Data s, Data t) => Data (Module s t) Source # | |
Defined in Swarm.Language.Module gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Module s t -> c (Module s t) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Module s t) # toConstr :: Module s t -> Constr # dataTypeOf :: Module s t -> DataType # dataCast1 :: Typeable t0 => (forall d. Data d => c (t0 d)) -> Maybe (c (Module s t)) # dataCast2 :: Typeable t0 => (forall d e. (Data d, Data e) => c (t0 d e)) -> Maybe (c (Module s t)) # gmapT :: (forall b. Data b => b -> b) -> Module s t -> Module s t # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Module s t -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Module s t -> r # gmapQ :: (forall d. Data d => d -> u) -> Module s t -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Module s t -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Module s t -> m (Module s t) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Module s t -> m (Module s t) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Module s t -> m (Module s t) # | |
Generic (Module s t) Source # | |
(Show s, Show t) => Show (Module s t) Source # | |
(Eq s, Eq t) => Eq (Module s t) Source # | |
type Rep (Module s t) Source # | |
Defined in Swarm.Language.Module type Rep (Module s t) = D1 ('MetaData "Module" "Swarm.Language.Module" "swarm-0.3.0.0-DptGDjHvXlqJcJyQcOsuxZ" 'False) (C1 ('MetaCons "Module" 'PrefixI 'True) (S1 ('MetaSel ('Just "moduleAST") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Syntax' s)) :*: S1 ('MetaSel ('Just "moduleCtx") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Ctx t)))) |
type TModule = Module Polytype Polytype Source #
A TModule
is the final result of the type inference process on
an expression: we get a polytype for the expression, and a
context of polytypes for the defined variables.