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

Lorentz.Iso

Description

Isomorphisms in Lorentz.

Synopsis

Documentation

data LIso a b Source #

Lorentz version of Control.Lens.Iso.

Constructors

LIso 

Fields

  • liTo :: forall s. (a : s) :-> (b : s)
     
  • liFrom :: forall s. (b : s) :-> (a : s)
     

invertIso :: LIso a b -> LIso b a Source #

Invert an isomorphism.

involutedIso :: Fn a a -> LIso a a Source #

Given a function that is its own inverse, make an LIso using it in both directions.

checkedCoerceIso :: Coercible_ a b => LIso a b Source #

The isomorphism between two values with identical representation and semantics.

forcedCoerceIso :: MichelsonCoercible a b => LIso a b Source #

The isomorphism between two values with identical representation.

The same precautions as for forcedCoerce apply here.

namedIso :: Label n -> LIso a (n :! a) Source #

The isomorphism between raw and named value.

nonIso :: (NiceConstant a, NiceComparable a) => a -> LIso (Maybe a) a Source #

Absence of value on the left hand side is associated with the given value on the right hand side.

nonDefIso :: (LDefault a, NiceConstant a) => LIso (Maybe a) a Source #

Absence of value on the left hand side is associated with the default value on the right hand side.

This is more general version of nonIso ldef since it can work with e.g. containers.