lorentz-0.15.1: EDSL for the Michelson Language
Safe HaskellSafe-Inferred
LanguageHaskell2010

Lorentz.Wrappable

Description

Permissions for casts between wrappers and their inner types.

Synopsis

Documentation

class ToT s ~ ToT (Unwrappabled s) => Unwrappable (s :: Type) Source #

Declares that this type is just a wrapper over some other type and it can be safely unwrapped to that inner type.

Inspired by lens Wrapped.

Associated Types

type Unwrappabled s :: Type Source #

The type we unwrap to (inner type of the newtype).

Used in constraint for Lorentz instruction wrapping into a Haskell newtype and vice versa.

type Unwrappabled s = GUnwrappabled s (Rep s)

Instances

Instances details
Unwrappable NRational Source # 
Instance details

Defined in Lorentz.CustomArith.RationalArith

Associated Types

type Unwrappabled NRational Source #

Unwrappable Rational Source # 
Instance details

Defined in Lorentz.CustomArith.RationalArith

Associated Types

type Unwrappabled Rational Source #

Unwrappable (UParam entries) Source # 
Instance details

Defined in Lorentz.UParam

Associated Types

type Unwrappabled (UParam entries) Source #

Unwrappable (Fixed a) Source # 
Instance details

Defined in Lorentz.Wrappable

Associated Types

type Unwrappabled (Fixed a) Source #

Unwrappable (NFixed a) Source # 
Instance details

Defined in Lorentz.CustomArith.FixedArith

Associated Types

type Unwrappabled (NFixed a) Source #

Unwrappable (ParameterWrapper deriv cp) Source # 
Instance details

Defined in Lorentz.Entrypoints.Manual

Associated Types

type Unwrappabled (ParameterWrapper deriv cp) Source #

Unwrappable (Extensible x) Source # 
Instance details

Defined in Lorentz.Extensible

Associated Types

type Unwrappabled (Extensible x) Source #

Unwrappable (STicket action td) Source # 
Instance details

Defined in Lorentz.Tickets

Associated Types

type Unwrappabled (STicket action td) Source #

Unwrappable (NamedF Identity a name) Source # 
Instance details

Defined in Lorentz.Wrappable

Associated Types

type Unwrappabled (NamedF Identity a name) Source #

Unwrappable (NamedF Maybe a name) Source # 
Instance details

Defined in Lorentz.Wrappable

Associated Types

type Unwrappabled (NamedF Maybe a name) Source #

class Unwrappable s => Wrappable (s :: Type) Source #

Declares that it is safe to wrap an inner type to the given wrapper type. Can be provided in addition to Unwrappable.

You can declare this instance when your wrapper exists just to make type system differentiate the two types. Example: newtype TokenId = TokenId Natural.

Do not define this instance for wrappers that provide some invariants. Example: UStore type from morley-upgradeable.

Wrappable is similar to lens Wrapped class without the method.

Instances

Instances details
Wrappable (ParameterWrapper deriv cp) Source # 
Instance details

Defined in Lorentz.Entrypoints.Manual

Wrappable (NamedF Identity a name) Source # 
Instance details

Defined in Lorentz.Wrappable

Wrappable (NamedF Maybe a name) Source # 
Instance details

Defined in Lorentz.Wrappable