Safe Haskell | None |
---|---|
Language | Haskell2010 |
Identity transformations between different Haskell types.
Synopsis
- type Coercible_ a b = ToT a ~ ToT b
- coerce_ :: Coercible_ a b => (a & s) :-> (b & s)
- gcoerce_ :: Coercible_ (t a) (t b) => (t a ': s) :-> (t b ': s)
- fakeCoerce :: s1 :-> s2
- coerceUnwrap :: Coercible_ newtyp (Unwrapped newtyp) => (newtyp ': s) :-> (Unwrapped newtyp ': s)
- coerceWrap :: Coercible_ newtyp (Unwrapped newtyp) => (Unwrapped newtyp ': s) :-> (newtyp ': s)
- toNamed :: Label name -> (a ': s) :-> (NamedF Identity a name ': s)
- fromNamed :: Label name -> (NamedF Identity a name ': s) :-> (a ': s)
- futureContract :: (Address ': s) :-> (FutureContract p ': s)
- unFutureContract :: (FutureContract p ': s) :-> (Address ': s)
- class Wrapped s where
Documentation
type Coercible_ a b = ToT a ~ ToT b Source #
Whether two types have the same Michelson representation.
coerce_ :: Coercible_ a b => (a & s) :-> (b & s) Source #
Convert between values of types that have the same representation.
gcoerce_ :: Coercible_ (t a) (t b) => (t a ': s) :-> (t b ': s) Source #
fakeCoerce :: s1 :-> s2 Source #
Convert between two stacks via failing.
coerceUnwrap :: Coercible_ newtyp (Unwrapped newtyp) => (newtyp ': s) :-> (Unwrapped newtyp ': s) Source #
Specialized version of coerce_
to unwrap a haskell newtype.
coerceWrap :: Coercible_ newtyp (Unwrapped newtyp) => (Unwrapped newtyp ': s) :-> (newtyp ': s) Source #
Specialized version of coerce_
to wrap into a haskell newtype.
toNamed :: Label name -> (a ': s) :-> (NamedF Identity a name ': s) Source #
Lift given value to a named value.
Coercions for some basic types
futureContract :: (Address ': s) :-> (FutureContract p ': s) Source #
Make up a FutureContract
.
unFutureContract :: (FutureContract p ': s) :-> (Address ': s) Source #
Get address referred by FutureContract
.
Re-exports
Wrapped
provides isomorphisms to wrap and unwrap newtypes or
data types with one constructor.
Nothing
_Wrapped' :: Iso' s (Unwrapped s) #
An isomorphism between s
and a
.
If your type has a Generic
instance, _Wrapped'
will default to _GWrapped'
,
and you can choose to not override it with your own definition.