Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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
.
Documentation
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
.