Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module defines generators for PIR syntax trees for testing purposes. It should only contain those generators that can't be reused from PLC (PIR-exclusive constructs, Term, and Program)
Synopsis
- type AstGen = GenT (Reader [Name])
- simpleRecursive ∷ MonadGen m ⇒ [m a] → [m a] → m a
- runAstGen ∷ MonadGen m ⇒ AstGen a → m a
- genVersion ∷ MonadGen m ⇒ m Version
- genKind ∷ AstGen (Kind ())
- genBuiltin ∷ (Bounded fun, Enum fun) ⇒ AstGen fun
- genConstant ∷ AstGen (Some (ValueOf DefaultUni))
- discardIfAnyConstant ∷ MonadGen m ⇒ (Some (ValueOf uni) → Bool) → m (Program tyname name uni fun ann) → m (Program tyname name uni fun ann)
- genProgram ∷ AstGen (Program TyName Name DefaultUni DefaultFun ())
- genTerm ∷ AstGen (Term TyName Name DefaultUni DefaultFun ())
- genBinding ∷ AstGen (Binding TyName Name DefaultUni DefaultFun ())
- genDatatype ∷ AstGen (Datatype TyName Name DefaultUni ())
- genTyVarDecl ∷ AstGen (TyVarDecl TyName ())
- genVarDecl ∷ AstGen (VarDecl TyName Name DefaultUni ())
- genRecursivity ∷ MonadGen m ⇒ m Recursivity
Documentation
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.
simpleRecursive ∷ MonadGen m ⇒ [m a] → [m a] → m a Source #
genVersion ∷ MonadGen m ⇒ m Version Source #
genConstant ∷ AstGen (Some (ValueOf DefaultUni)) Source #
discardIfAnyConstant ∷ MonadGen m ⇒ (Some (ValueOf uni) → Bool) → m (Program tyname name uni fun ann) → m (Program tyname name uni fun ann) Source #
genProgram ∷ AstGen (Program TyName Name DefaultUni DefaultFun ()) Source #
genTerm ∷ AstGen (Term TyName Name DefaultUni DefaultFun ()) Source #
genBinding ∷ AstGen (Binding TyName Name DefaultUni DefaultFun ()) Source #
genDatatype ∷ AstGen (Datatype TyName Name DefaultUni ()) Source #
genVarDecl ∷ AstGen (VarDecl TyName Name DefaultUni ()) Source #
genRecursivity ∷ MonadGen m ⇒ m Recursivity Source #