morley-1.18.0: Developer tools for the Michelson Language
Safe HaskellSafe-Inferred
LanguageHaskell2010

Morley.Michelson.Typed.Extract

Description

Module, containing functions to convert Morley.Michelson.Untyped.Ty to Morley.Michelson.Typed.T.T Michelson type representation (type stripped off all annotations) and to Morley.Michelson.Typed.Annotation.Notes value (which contains field and type annotations for a given Michelson type).

I.e. Morley.Michelson.Untyped.Ty is split to value t :: T and value of type Notes t for which t is a type representation of value t.

Synopsis

Documentation

toUType :: T -> Ty Source #

Converts from T to Ty.

withUType :: Ty -> (forall t. SingI t => Notes t -> r) -> r Source #

Convert Ty to the isomorphic set of information from typed world.

pattern AsUType :: () => SingI t => Notes t -> Ty Source #

Transparently represent untyped Ty as wrapper over Notes t from typed world with SingI t constraint.

As expression this carries logic of mkUType, and as pattern it performs withUType but may make code a bit cleaner.

Note about constraints: pattern signatures usually require two constraints - one they require and another one which they provide. In our case we require nothing (thus first constraint is ()) and provide some knowledge about t.

pattern AsUTypeExt :: () => SingI t => Sing t -> Notes t -> Ty Source #

Similar to AsUType, but also gives Sing for given type.