morley-0.4.0: src/Lorentz/Pack.hs
-- | Packing utilities.
module Lorentz.Pack
( lPackValue
, lUnpackValue
) where
import Data.Constraint ((\\))
import Lorentz.Constraints
import Michelson.Interpret.Pack
import Michelson.Interpret.Unpack
import Michelson.Typed
lPackValue
:: forall a.
(NicePackedValue a)
=> a -> ByteString
lPackValue =
packValue' . toVal \\ nicePackedValueEvi @a
lUnpackValue
:: forall a.
(NiceUnpackedValue a)
=> ByteString -> Either UnpackError a
lUnpackValue =
fmap fromVal . unpackValue' \\ niceUnpackedValueEvi @a