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

Lorentz.Constraints.Derivative

Description

Some derivative constraints.

They are moved to separate module because they need to lie quite high in modules dependencies graph (unlike Lorentz.Constraints.Scopes).

Synopsis

Documentation

type NiceParameterFull cp = (Typeable cp, ParameterDeclaresEntrypoints cp) Source #

Constraint applied to a whole parameter type.

data DupableDecision a Source #

Tells whether given type is dupable or not.

Constructors

Dupable a => IsDupable 
IsNotDupable 

decideOnDupable :: forall a. KnownValue a => DupableDecision a Source #

Check whether given value is dupable, returning a proof of that when it is.

This lets defining methods that behave differently depending on whether given value is dupable or not. This may be suitable when for the dupable case you can provide a more efficient implementation, but you also want your implementation to be generic.

Example:

code = case decideOnDupable @a of
  IsDupable -> do dup; ...
  IsNotDupable -> ...

type NiceViews vs = RequireAllUnique "view" (ViewsNames vs) Source #

Require views set to be proper.

type NiceViewsDescriptor vd = NiceViews (RevealViews vd) Source #

Require views set referred by the given views descriptor to be proper.