Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- simpleRecursive ∷ MonadGen m ⇒ [m a] → [m a] → m a
- discardIfAnyConstant ∷ MonadGen m ⇒ (Some (ValueOf uni) → Bool) → m (Program tyname name uni fun ann) → m (Program tyname name uni fun ann)
- type AstGen = GenT (Reader [Name])
- runAstGen ∷ MonadGen m ⇒ AstGen a → m a
- genVersion ∷ MonadGen m ⇒ m Version
- genNames ∷ MonadGen m ⇒ m [Name]
- genName ∷ AstGen Name
- genTyName ∷ AstGen TyName
- genKind ∷ AstGen (Kind ())
- genBuiltin ∷ (Bounded fun, Enum fun) ⇒ AstGen fun
- genConstant ∷ AstGen (Some (ValueOf DefaultUni))
- genType ∷ AstGen (Type TyName DefaultUni ())
- genTerm ∷ ∀ fun. (Bounded fun, Enum fun) ⇒ AstGen (Term TyName Name DefaultUni fun ())
- genProgram ∷ ∀ fun. (Bounded fun, Enum fun) ⇒ AstGen (Program TyName Name DefaultUni fun ())
- mangleNames ∷ Term TyName Name DefaultUni DefaultFun () → AstGen (Maybe (Term TyName Name DefaultUni DefaultFun ()))
Documentation
simpleRecursive ∷ MonadGen m ⇒ [m a] → [m a] → m a Source #
discardIfAnyConstant ∷ MonadGen m ⇒ (Some (ValueOf uni) → Bool) → m (Program tyname name uni fun ann) → m (Program tyname name uni fun ann) Source #
type AstGen = GenT (Reader [Name]) Source #
The monad that generators run in. The environment is a list of names to choose from for generation of variables and binders.
genVersion ∷ MonadGen m ⇒ m Version Source #
genNames ∷ MonadGen m ⇒ m [Name] Source #
Generate a fixed set of names which we will use, of only up to a short size to make it
likely that we get reuse.
We do not attempt not to generate reserved words such as all
or abs
as the classic syntax
parsers (both PLC and PIR ones) can handle names of variables clashing with reserved words.
In the readable syntax that would be troubling, though, but we don't have a parser for that anyway.
genConstant ∷ AstGen (Some (ValueOf DefaultUni)) Source #
genProgram ∷ ∀ fun. (Bounded fun, Enum fun) ⇒ AstGen (Program TyName Name DefaultUni fun ()) Source #
mangleNames ∷ Term TyName Name DefaultUni DefaultFun () → AstGen (Maybe (Term TyName Name DefaultUni DefaultFun ())) Source #