plutus-core-1.30.0.0: Language library for Plutus Core
Safe HaskellSafe-Inferred
LanguageHaskell2010

PlutusCore.Generators.NEAT.Term

Description

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

Documentation

data TypeBuiltinG Source #

Instances

Instances details
Show TypeBuiltinG Source # 
Instance details

Defined in PlutusCore.Generators.NEAT.Type

Eq TypeBuiltinG Source # 
Instance details

Defined in PlutusCore.Generators.NEAT.Type

Ord TypeBuiltinG Source # 
Instance details

Defined in PlutusCore.Generators.NEAT.Type

Enumerable TypeBuiltinG Source # 
Instance details

Defined in PlutusCore.Generators.NEAT.Type

Methods

enumerate ∷ ∀ (f ∷ TypeType). (Typeable f, Sized f) ⇒ Shared f TypeBuiltinG

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?

Instance details

Defined in PlutusCore.Generators.NEAT.Term

Methods

checkKind () → TypeBuiltinG → Cool Source #

data TermConstantG Source #

Constructors

TmIntegerG Integer 
TmByteStringG ByteString 
TmStringG Text 
TmBoolG Bool 
TmUnitG () 
TmDataG Data 

Instances

Instances details
Show TermConstantG Source # 
Instance details

Defined in PlutusCore.Generators.NEAT.Term

Eq TermConstantG Source # 
Instance details

Defined in PlutusCore.Generators.NEAT.Term

Enumerable TermConstantG Source # 
Instance details

Defined in PlutusCore.Generators.NEAT.Term

Methods

enumerate ∷ ∀ (f ∷ TypeType). (Typeable f, Sized f) ⇒ Shared f TermConstantG

Check (TypeG n) TermConstantG Source # 
Instance details

Defined in PlutusCore.Generators.NEAT.Term

Methods

checkTypeG n → TermConstantG → Cool Source #

data TypeG n Source #

Constructors

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

Instances details
Applicative TypeG Source # 
Instance details

Defined in PlutusCore.Generators.NEAT.Type

Methods

pure ∷ a → TypeG a Source #

(<*>)TypeG (a → b) → TypeG a → TypeG b Source #

liftA2 ∷ (a → b → c) → TypeG a → TypeG b → TypeG c Source #

(*>)TypeG a → TypeG b → TypeG b Source #

(<*)TypeG a → TypeG b → TypeG a Source #

Functor TypeG Source # 
Instance details

Defined in PlutusCore.Generators.NEAT.Type

Methods

fmap ∷ (a → b) → TypeG a → TypeG b Source #

(<$) ∷ a → TypeG b → TypeG a Source #

Monad TypeG Source # 
Instance details

Defined in PlutusCore.Generators.NEAT.Type

Methods

(>>=)TypeG a → (a → TypeG b) → TypeG b Source #

(>>)TypeG a → TypeG b → TypeG b Source #

return ∷ a → TypeG a Source #

Check ClosedTypeG ClosedTermG Source # 
Instance details

Defined in PlutusCore.Generators.NEAT.Term

Methods

checkClosedTypeGClosedTermG → Cool Source #

Show n ⇒ Show (TypeG n) Source # 
Instance details

Defined in PlutusCore.Generators.NEAT.Type

Methods

showsPrecIntTypeG n → ShowS Source #

showTypeG n → String Source #

showList ∷ [TypeG n] → ShowS Source #

Eq n ⇒ Eq (TypeG n) Source # 
Instance details

Defined in PlutusCore.Generators.NEAT.Type

Methods

(==)TypeG n → TypeG n → Bool Source #

(/=)TypeG n → TypeG n → Bool Source #

Ord n ⇒ Ord (TypeG n) Source # 
Instance details

Defined in PlutusCore.Generators.NEAT.Type

Methods

compareTypeG n → TypeG n → Ordering Source #

(<)TypeG n → TypeG n → Bool Source #

(<=)TypeG n → TypeG n → Bool Source #

(>)TypeG n → TypeG n → Bool Source #

(>=)TypeG n → TypeG n → Bool Source #

maxTypeG n → TypeG n → TypeG n Source #

minTypeG n → TypeG n → TypeG n Source #

Enumerable tyname ⇒ Enumerable (Normalized (TypeG tyname)) 
Instance details

Defined in PlutusCore.Generators.NEAT.Term

Methods

enumerate ∷ ∀ (f ∷ TypeType). (Typeable f, Sized f) ⇒ Shared f (Normalized (TypeG tyname))

Enumerable tyname ⇒ Enumerable (Neutral (TypeG tyname)) 
Instance details

Defined in PlutusCore.Generators.NEAT.Term

Methods

enumerate ∷ ∀ (f ∷ TypeType). (Typeable f, Sized f) ⇒ Shared f (Neutral (TypeG tyname))

Enumerable n ⇒ Enumerable (TypeG n) Source # 
Instance details

Defined in PlutusCore.Generators.NEAT.Type

Methods

enumerate ∷ ∀ (f ∷ TypeType). (Typeable f, Sized f) ⇒ Shared f (TypeG n)

Check (Kind ()) ClosedTypeG Source # 
Instance details

Defined in PlutusCore.Generators.NEAT.Term

Methods

checkKind () → ClosedTypeG → Cool Source #

Check (TypeG n) TermConstantG Source # 
Instance details

Defined in PlutusCore.Generators.NEAT.Term

Methods

checkTypeG n → TermConstantG → Cool Source #

Ord tyname ⇒ Check (TypeG tyname) DefaultFun Source # 
Instance details

Defined in PlutusCore.Generators.NEAT.Term

Methods

checkTypeG tyname → DefaultFun → Cool Source #

Check (Kind ()) (Normalized ClosedTypeG) Source # 
Instance details

Defined in PlutusCore.Generators.NEAT.Term

Methods

checkKind () → Normalized ClosedTypeG → Cool 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 #

Constructors

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

Instances details
Bifunctor TermG Source # 
Instance details

Defined in PlutusCore.Generators.NEAT.Term

Methods

bimap ∷ (a → b) → (c → d) → TermG a c → TermG b d Source #

first ∷ (a → b) → TermG a c → TermG b c Source #

second ∷ (b → c) → TermG a b → TermG a c Source #

Check ClosedTypeG ClosedTermG Source # 
Instance details

Defined in PlutusCore.Generators.NEAT.Term

Methods

checkClosedTypeGClosedTermG → Cool Source #

Functor (TermG tyname) Source # 
Instance details

Defined in PlutusCore.Generators.NEAT.Term

Methods

fmap ∷ (a → b) → TermG tyname a → TermG tyname b Source #

(<$) ∷ a → TermG tyname b → TermG tyname a Source #

(Show name, Show tyname) ⇒ Show (TermG tyname name) Source # 
Instance details

Defined in PlutusCore.Generators.NEAT.Term

Methods

showsPrecIntTermG tyname name → ShowS Source #

showTermG tyname name → String Source #

showList ∷ [TermG tyname name] → ShowS Source #

(Eq name, Eq tyname) ⇒ Eq (TermG tyname name) Source # 
Instance details

Defined in PlutusCore.Generators.NEAT.Term

Methods

(==)TermG tyname name → TermG tyname name → Bool Source #

(/=)TermG tyname name → TermG tyname name → Bool Source #

(Enumerable tyname, Enumerable name) ⇒ Enumerable (TermG tyname name) Source # 
Instance details

Defined in PlutusCore.Generators.NEAT.Term

Methods

enumerate ∷ ∀ (f ∷ TypeType). (Typeable f, Sized f) ⇒ Shared f (TermG tyname name)

convertClosedTerm ∷ (MonadQuote m, MonadError GenError m) ⇒ Stream Text → Stream Text → ClosedTypeGClosedTermG → m (Term TyName Name DefaultUni DefaultFun ()) Source #

Convert generated closed terms to Plutus terms.

class Check t a where Source #

Methods

check ∷ t → a → Cool Source #

Instances

Instances details
Check ClosedTypeG ClosedTermG Source # 
Instance details

Defined in PlutusCore.Generators.NEAT.Term

Methods

checkClosedTypeGClosedTermG → Cool Source #

Check (Kind ()) ClosedTypeG Source # 
Instance details

Defined in PlutusCore.Generators.NEAT.Term

Methods

checkKind () → ClosedTypeG → Cool Source #

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?

Instance details

Defined in PlutusCore.Generators.NEAT.Term

Methods

checkKind () → TypeBuiltinG → Cool Source #

Check (TypeG n) TermConstantG Source # 
Instance details

Defined in PlutusCore.Generators.NEAT.Term

Methods

checkTypeG n → TermConstantG → Cool Source #

Ord tyname ⇒ Check (TypeG tyname) DefaultFun Source # 
Instance details

Defined in PlutusCore.Generators.NEAT.Term

Methods

checkTypeG tyname → DefaultFun → Cool Source #

Check (Kind ()) (Normalized ClosedTypeG) Source # 
Instance details

Defined in PlutusCore.Generators.NEAT.Term

Methods

checkKind () → Normalized ClosedTypeG → Cool Source #

stepTypeGTypeG n → Maybe (TypeG n) Source #

Reduce a generated type by a single step, or fail.

normalizeTypeGTypeG n → TypeG n Source #

Normalise a generated type.

data GenError Source #

Constructors

∀ tyname.Show tyname ⇒ BadTypeG (Kind ()) (TypeG tyname) 
∀ tyname name.(Show tyname, Show name) ⇒ BadTermG (TypeG tyname) (TermG tyname name) 

Instances

Instances details
Show GenError Source # 
Instance details

Defined in PlutusCore.Generators.NEAT.Term

newtype Neutral a Source #

Constructors

Neutral 

Fields

Instances

Instances details
Enumerable tyname ⇒ Enumerable (Neutral (TypeG tyname)) 
Instance details

Defined in PlutusCore.Generators.NEAT.Term

Methods

enumerate ∷ ∀ (f ∷ TypeType). (Typeable f, Sized f) ⇒ Shared f (Neutral (TypeG tyname))

Orphan instances

Enumerable ByteString Source # 
Instance details

Methods

enumerate ∷ ∀ (f ∷ TypeType). (Typeable f, Sized f) ⇒ Shared f ByteString

Enumerable Data Source # 
Instance details

Methods

enumerate ∷ ∀ (f ∷ TypeType). (Typeable f, Sized f) ⇒ Shared f Data

Enumerable DefaultFun Source # 
Instance details

Methods

enumerate ∷ ∀ (f ∷ TypeType). (Typeable f, Sized f) ⇒ Shared f DefaultFun

Enumerable Text Source # 
Instance details

Methods

enumerate ∷ ∀ (f ∷ TypeType). (Typeable f, Sized f) ⇒ Shared f Text

Enumerable tyname ⇒ Enumerable (Normalized (TypeG tyname)) Source # 
Instance details

Methods

enumerate ∷ ∀ (f ∷ TypeType). (Typeable f, Sized f) ⇒ Shared f (Normalized (TypeG tyname))

Enumerable tyname ⇒ Enumerable (Neutral (TypeG tyname)) Source # 
Instance details

Methods

enumerate ∷ ∀ (f ∷ TypeType). (Typeable f, Sized f) ⇒ Shared f (Neutral (TypeG tyname))