small-steps-0.1.0.0: Small step semantics
Safe HaskellNone
LanguageHaskell2010

Data.MemoBytes

Description

MemoBytes is an abstration for a datetype that encodes its own serialization. The idea is to use a newtype around a MemoBytes non-memoizing version. For example: newtype Foo = Foo(MemoBytes NonMemoizingFoo) This way all the instances for Foo (Eq,Show,Ord,ToCBOR,FromCBOR,NoThunks,Generic) can be derived for free.

Synopsis

Documentation

data MemoBytes t Source #

Constructors

Memo 

Instances

Instances details
Eq t => Eq (MemoBytes t) Source # 
Instance details

Defined in Data.MemoBytes

Methods

(==) :: MemoBytes t -> MemoBytes t -> Bool #

(/=) :: MemoBytes t -> MemoBytes t -> Bool #

Ord t => Ord (MemoBytes t) Source # 
Instance details

Defined in Data.MemoBytes

Show t => Show (MemoBytes t) Source # 
Instance details

Defined in Data.MemoBytes

Generic (MemoBytes t) Source # 
Instance details

Defined in Data.MemoBytes

Associated Types

type Rep (MemoBytes t) :: Type -> Type #

Methods

from :: MemoBytes t -> Rep (MemoBytes t) x #

to :: Rep (MemoBytes t) x -> MemoBytes t #

Typeable t => ToCBOR (MemoBytes t) Source # 
Instance details

Defined in Data.MemoBytes

Methods

toCBOR :: MemoBytes t -> Encoding Source #

encodedSizeExpr :: (forall t0. ToCBOR t0 => Proxy t0 -> Size) -> Proxy (MemoBytes t) -> Size Source #

encodedListSizeExpr :: (forall t0. ToCBOR t0 => Proxy t0 -> Size) -> Proxy [MemoBytes t] -> Size Source #

(Typeable t, FromCBOR (Annotator t)) => FromCBOR (Annotator (MemoBytes t)) Source # 
Instance details

Defined in Data.MemoBytes

NFData t => NFData (MemoBytes t) Source # 
Instance details

Defined in Data.MemoBytes

Methods

rnf :: MemoBytes t -> () #

(Typeable t, NoThunks t) => NoThunks (MemoBytes t) Source # 
Instance details

Defined in Data.MemoBytes

type Rep (MemoBytes t) Source # 
Instance details

Defined in Data.MemoBytes

type Rep (MemoBytes t) = D1 ('MetaData "MemoBytes" "Data.MemoBytes" "small-steps-0.1.0.0-2ipJpwzZFt642witnrAmH1" 'False) (C1 ('MetaCons "Memo" 'PrefixI 'True) (S1 ('MetaSel ('Just "memotype") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 t) :*: S1 ('MetaSel ('Just "memobytes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ShortByteString)))

type Mem t = Annotator (MemoBytes t) Source #

Useful when deriving FromCBOR(Annotator T) deriving via (Mem T) instance (Era era) => FromCBOR (Annotator T)

printMemo :: Show t => MemoBytes t -> IO () Source #