Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This file contains 1. A duplicate of the Plutus Core Abstract Syntax (types and terms) 2. A kind checker and a type checker 3. Reduction semantics for types
Synopsis
- data TypeBuiltinG
- data TermConstantG
- data TypeG n
- type ClosedTypeG = TypeG Z
- convertClosedType ∷ (MonadQuote m, MonadError GenError m) ⇒ Stream Text → Kind () → ClosedTypeG → m (Type TyName DefaultUni ())
- data TermG tyname name
- = VarG name
- | LamAbsG (TermG tyname (S name))
- | ApplyG (TermG tyname name) (TermG tyname name) (TypeG tyname)
- | TyAbsG (TermG (S tyname) name)
- | TyInstG (TermG tyname name) (TypeG (S tyname)) (TypeG tyname) (Kind ())
- | ConstantG TermConstantG
- | BuiltinG DefaultFun
- | WrapG (TermG tyname name)
- | UnWrapG (TypeG tyname) (Kind ()) (TypeG tyname) (TermG tyname name)
- | ErrorG (TypeG tyname)
- type ClosedTermG = TermG Z Z
- convertClosedTerm ∷ (MonadQuote m, MonadError GenError m) ⇒ Stream Text → Stream Text → ClosedTypeG → ClosedTermG → m (Term TyName Name DefaultUni DefaultFun ())
- class Check t a where
- stepTypeG ∷ TypeG n → Maybe (TypeG n)
- normalizeTypeG ∷ TypeG n → TypeG n
- data GenError
- newtype Neutral a = Neutral {
- unNeutral ∷ a
Documentation
data TypeBuiltinG Source #
Instances
Show TypeBuiltinG Source # | |
Defined in PlutusCore.Generators.NEAT.Type | |
Eq TypeBuiltinG Source # | |
Defined in PlutusCore.Generators.NEAT.Type (==) ∷ TypeBuiltinG → TypeBuiltinG → Bool Source # (/=) ∷ TypeBuiltinG → TypeBuiltinG → Bool Source # | |
Ord TypeBuiltinG Source # | |
Defined in PlutusCore.Generators.NEAT.Type compare ∷ TypeBuiltinG → TypeBuiltinG → Ordering Source # (<) ∷ TypeBuiltinG → TypeBuiltinG → Bool Source # (<=) ∷ TypeBuiltinG → TypeBuiltinG → Bool Source # (>) ∷ TypeBuiltinG → TypeBuiltinG → Bool Source # (>=) ∷ TypeBuiltinG → TypeBuiltinG → Bool Source # | |
Enumerable TypeBuiltinG Source # | |
Defined in PlutusCore.Generators.NEAT.Type | |
Check (Kind ()) TypeBuiltinG Source # | Kind check builtin types. NOTE: If we make |checkTypeBuiltinG| non-strict in its second argument, lazy-search will only ever return one of the various builtin types. Perhaps this is preferable? |
Defined in PlutusCore.Generators.NEAT.Term |
data TermConstantG Source #
Instances
Show TermConstantG Source # | |
Defined in PlutusCore.Generators.NEAT.Term | |
Eq TermConstantG Source # | |
Defined in PlutusCore.Generators.NEAT.Term (==) ∷ TermConstantG → TermConstantG → Bool Source # (/=) ∷ TermConstantG → TermConstantG → Bool Source # | |
Enumerable TermConstantG Source # | |
Defined in PlutusCore.Generators.NEAT.Term | |
Check (TypeG n) TermConstantG Source # | |
Defined in PlutusCore.Generators.NEAT.Term |
TyVarG n | |
TyFunG (TypeG n) (TypeG n) | |
TyIFixG (TypeG n) (Kind ()) (TypeG n) | |
TyForallG (Kind ()) (TypeG (S n)) | |
TyBuiltinG TypeBuiltinG | |
TyLamG (TypeG (S n)) | |
TyAppG (TypeG n) (TypeG n) (Kind ()) |
Instances
Applicative TypeG Source # | |
Functor TypeG Source # | |
Monad TypeG Source # | |
Check ClosedTypeG ClosedTermG Source # | |
Defined in PlutusCore.Generators.NEAT.Term check ∷ ClosedTypeG → ClosedTermG → Cool Source # | |
Show n ⇒ Show (TypeG n) Source # | |
Eq n ⇒ Eq (TypeG n) Source # | |
Ord n ⇒ Ord (TypeG n) Source # | |
Defined in PlutusCore.Generators.NEAT.Type | |
Enumerable tyname ⇒ Enumerable (Normalized (TypeG tyname)) Source # | |
Enumerable tyname ⇒ Enumerable (Neutral (TypeG tyname)) Source # | |
Enumerable n ⇒ Enumerable (TypeG n) Source # | |
Check (Kind ()) ClosedTypeG Source # | |
Defined in PlutusCore.Generators.NEAT.Term | |
Check (TypeG n) TermConstantG Source # | |
Defined in PlutusCore.Generators.NEAT.Term | |
Ord tyname ⇒ Check (TypeG tyname) DefaultFun Source # | |
Defined in PlutusCore.Generators.NEAT.Term | |
Check (Kind ()) (Normalized ClosedTypeG) Source # | |
Defined in PlutusCore.Generators.NEAT.Term check ∷ Kind () → Normalized ClosedTypeG → Cool Source # |
type ClosedTypeG = TypeG Z Source #
convertClosedType ∷ (MonadQuote m, MonadError GenError m) ⇒ Stream Text → Kind () → ClosedTypeG → m (Type TyName DefaultUni ()) Source #
Convert generated closed types to Plutus types.
data TermG tyname name Source #
VarG name | |
LamAbsG (TermG tyname (S name)) | |
ApplyG (TermG tyname name) (TermG tyname name) (TypeG tyname) | |
TyAbsG (TermG (S tyname) name) | |
TyInstG (TermG tyname name) (TypeG (S tyname)) (TypeG tyname) (Kind ()) | |
ConstantG TermConstantG | |
BuiltinG DefaultFun | |
WrapG (TermG tyname name) | |
UnWrapG (TypeG tyname) (Kind ()) (TypeG tyname) (TermG tyname name) | |
ErrorG (TypeG tyname) |
Instances
Bifunctor TermG Source # | |
Check ClosedTypeG ClosedTermG Source # | |
Defined in PlutusCore.Generators.NEAT.Term check ∷ ClosedTypeG → ClosedTermG → Cool Source # | |
Functor (TermG tyname) Source # | |
(Show name, Show tyname) ⇒ Show (TermG tyname name) Source # | |
(Eq name, Eq tyname) ⇒ Eq (TermG tyname name) Source # | |
(Enumerable tyname, Enumerable name) ⇒ Enumerable (TermG tyname name) Source # | |
convertClosedTerm ∷ (MonadQuote m, MonadError GenError m) ⇒ Stream Text → Stream Text → ClosedTypeG → ClosedTermG → m (Term TyName Name DefaultUni DefaultFun ()) Source #
Convert generated closed terms to Plutus terms.
class Check t a where Source #
Instances
Check ClosedTypeG ClosedTermG Source # | |
Defined in PlutusCore.Generators.NEAT.Term check ∷ ClosedTypeG → ClosedTermG → Cool Source # | |
Check (Kind ()) ClosedTypeG Source # | |
Defined in PlutusCore.Generators.NEAT.Term | |
Check (Kind ()) TypeBuiltinG Source # | Kind check builtin types. NOTE: If we make |checkTypeBuiltinG| non-strict in its second argument, lazy-search will only ever return one of the various builtin types. Perhaps this is preferable? |
Defined in PlutusCore.Generators.NEAT.Term | |
Check (TypeG n) TermConstantG Source # | |
Defined in PlutusCore.Generators.NEAT.Term | |
Ord tyname ⇒ Check (TypeG tyname) DefaultFun Source # | |
Defined in PlutusCore.Generators.NEAT.Term | |
Check (Kind ()) (Normalized ClosedTypeG) Source # | |
Defined in PlutusCore.Generators.NEAT.Term check ∷ Kind () → Normalized ClosedTypeG → Cool Source # |
normalizeTypeG ∷ TypeG n → TypeG n Source #
Normalise a generated type.
Orphan instances
Enumerable ByteString Source # | |
Enumerable Data Source # | |
Enumerable DefaultFun Source # | |
Enumerable Text Source # | |
Enumerable tyname ⇒ Enumerable (Normalized (TypeG tyname)) Source # | |
Enumerable tyname ⇒ Enumerable (Neutral (TypeG tyname)) Source # | |