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)
- 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)
- 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.
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.
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.