morley-0.7.0: Developer tools for the Michelson Language

Safe HaskellNone
LanguageHaskell2010

Lorentz.Base

Description

Foundation of Lorentz development.

Synopsis

Documentation

newtype (inp :: [Type]) :-> (out :: [Type]) infixr 1 Source #

Alias for instruction which hides inner types representation via T.

Constructors

LorentzInstr 

Fields

Instances
(CanCastTo i1 i2, CanCastTo o1 o2) => CanCastTo (Lambda i1 o1 :: Type) (Lambda i2 o2 :: Type) Source # 
Instance details

Defined in Lorentz.Coercions

Methods

castDummy :: () Source #

Eq (inp :-> out) Source # 
Instance details

Defined in Lorentz.Base

Methods

(==) :: (inp :-> out) -> (inp :-> out) -> Bool #

(/=) :: (inp :-> out) -> (inp :-> out) -> Bool #

Show (inp :-> out) Source # 
Instance details

Defined in Lorentz.Base

Methods

showsPrec :: Int -> (inp :-> out) -> ShowS #

show :: (inp :-> out) -> String #

showList :: [inp :-> out] -> ShowS #

Semigroup (s :-> s) Source # 
Instance details

Defined in Lorentz.Base

Methods

(<>) :: (s :-> s) -> (s :-> s) -> s :-> s #

sconcat :: NonEmpty (s :-> s) -> s :-> s #

stimes :: Integral b => b -> (s :-> s) -> s :-> s #

Monoid (s :-> s) Source # 
Instance details

Defined in Lorentz.Base

Methods

mempty :: s :-> s #

mappend :: (s :-> s) -> (s :-> s) -> s :-> s #

mconcat :: [s :-> s] -> s :-> s #

(ZipInstr inp, ZipInstr out) => IsoValue (inp :-> out) Source # 
Instance details

Defined in Lorentz.Zip

Associated Types

type ToT (inp :-> out) :: T Source #

Methods

toVal :: (inp :-> out) -> Value (ToT (inp :-> out)) Source #

fromVal :: Value (ToT (inp :-> out)) -> inp :-> out Source #

Each ((Typeable :: [Type] -> Constraint) ': (ReifyList TypeHasDoc ': ([] :: [[Type] -> Constraint]))) (i ': (o ': ([] :: [[Type]]))) => TypeHasDoc (i :-> o) Source # 
Instance details

Defined in Lorentz.Doc

(HasTypeAnn (ZippedStack i), HasTypeAnn (ZippedStack o)) => HasTypeAnn (i :-> o) Source # 
Instance details

Defined in Lorentz.TypeAnns

Methods

getTypeAnn :: Notes (ToT (i :-> o)) Source #

(i ~ (MUStore oldTempl newTempl diff touched ': s), o ~ (MUStore oldTempl newTempl ([] :: [DiffItem]) touched ': s), RequireEmptyDiff diff) => MigrationFinishCheckPosition (i :-> o) Source #

This version can be used in mkUStoreMigration.

Instance details

Defined in Lorentz.UStore.Migration.Blocks

Methods

migrationFinish :: i :-> o Source #

type ToT (inp :-> out) Source # 
Instance details

Defined in Lorentz.Zip

type ToT (inp :-> out) = TLambda (ToT (ZippedStack inp)) (ToT (ZippedStack out))

type (%>) = (:->) infixr 1 Source #

Alias for :->, seems to make signatures more readable sometimes.

Let's someday decide which one of these two should remain.

type (&) (a :: Type) (b :: [Type]) = a ': b infixr 2 Source #

(#) :: (a :-> b) -> (b :-> c) -> a :-> c infixl 8 Source #

(##) :: (a :-> b) -> (b :-> c) -> a :-> c Source #

Version of # which performs some optimizations immediately.

pattern I :: Instr (ToTs inp) (ToTs out) -> inp :-> out Source #

pattern FI :: (forall out'. Instr (ToTs inp) out') -> inp :-> out Source #

iGenericIf :: (forall s'. Instr (ToTs a) s' -> Instr (ToTs b) s' -> Instr (ToTs c) s') -> (a :-> s) -> (b :-> s) -> c :-> s Source #

iAnyCode :: (inp :-> out) -> Instr (ToTs inp) (ToTs out) Source #

iNonFailingCode :: HasCallStack => (inp :-> out) -> Instr (ToTs inp) (ToTs out) Source #

iMapAnyCode :: (forall o'. Instr (ToTs i1) o' -> Instr (ToTs i2) o') -> (i1 :-> o) -> i2 :-> o Source #

iForceNotFail :: (i :-> o) -> i :-> o Source #

iWithVarAnnotations :: HasCallStack => [Text] -> (inp :-> out) -> inp :-> out Source #

Wrap Lorentz instruction with variable annotations, annots list has to be non-empty, otherwise this function raises an error.

parseLorentzValue :: forall v. (IsoValue v, SingI (ToT v), Typeable (ToT v)) => Text -> Either ParseLorentzError v Source #

Parse textual representation of a Michelson value and turn it into corresponding Haskell value.

Note: it won't work in some complex cases, e. g. if there is a lambda which uses an instruction which depends on current contract's type. Obviously it can not work, because we don't have any information about a contract to which this value belongs (there is no such contract at all).

transformStringsLorentz :: Bool -> (MText -> MText) -> (inp :-> out) -> inp :-> out Source #

Lorentz version of transformStrings.

transformBytesLorentz :: Bool -> (ByteString -> ByteString) -> (inp :-> out) -> inp :-> out Source #

Lorentz version of transformBytes.

optimizeLorentz :: (inp :-> out) -> inp :-> out Source #

type ContractOut st = '[([Operation], st)] Source #

type Contract cp st = '[(cp, st)] :-> ContractOut st Source #

data SomeContract where Source #

Constructors

SomeContract :: (NiceParameterFull cp, NiceStorage st) => Contract cp st -> SomeContract 

type Lambda i o = '[i] :-> '[o] Source #