morley-1.12.0: Developer tools for the Michelson Language
Safe HaskellNone
LanguageHaskell2010

Michelson.Typed.Extract

Description

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

I.e. Michelson.Untyped.Type 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 -> Type Source #

Converts from T to Type.

withUType :: Type -> (forall t. KnownT t => Notes t -> r) -> r Source #

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

pattern AsUType :: () => KnownT t => Notes t -> Type Source #

Transparently represent untyped Type 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 :: () => KnownT t => Sing t -> Notes t -> Type Source #

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