Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Gen v loc a = Gen {}
- data GenState v loc = GenState {}
- type GeneratedConstraint v loc = Constraint (UVar v loc) v loc Provenance
- run :: Gen v loc a -> GenState v loc -> (a, GenState v loc)
- freshVar :: Var v => Type v loc -> Gen v loc (UVar v loc)
- pushType :: Var v => Type v loc -> Gen v loc (UVar v loc)
- popType :: Var v => Type v loc -> Gen v loc ()
- scopedType :: Var v => Type v loc -> (UVar v loc -> Gen v loc r) -> Gen v loc r
- lookupType :: Var v => Type v loc -> Gen v loc (Maybe (UVar v loc))
Documentation
The Gen
monad state
Instances
Generic (GenState v loc) Source # | |
MonadState (GenState v loc) (Gen v loc) Source # | |
type Rep (GenState v loc) Source # | |
Defined in Unison.KindInference.Generate.Monad type Rep (GenState v loc) = D1 ('MetaData "GenState" "Unison.KindInference.Generate.Monad" "unison-parser-typechecker-0.0.0-JliU30UQmMa2dDW5SxUdL" 'False) (C1 ('MetaCons "GenState" 'PrefixI 'True) (S1 ('MetaSel ('Just "unifVars") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set Symbol)) :*: (S1 ('MetaSel ('Just "typeMap") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (Type v loc) (NonEmpty (UVar v loc)))) :*: S1 ('MetaSel ('Just "newVars") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [UVar v loc])))) |
type GeneratedConstraint v loc = Constraint (UVar v loc) v loc Provenance Source #
A generated constraint
freshVar :: Var v => Type v loc -> Gen v loc (UVar v loc) Source #
Create a unique UVar
associated with typ
pushType :: Var v => Type v loc -> Gen v loc (UVar v loc) Source #
Associate a fresh UVar
with t
, push onto context