marconi-cardano-core-1.2.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Marconi.Cardano.Core.Extract.WithDistance

Description

Attach distance to the tip to an event

Synopsis

Documentation

data WithDistance event #

A type to store the distance, in blocks, to the tip of the chain

Constructors

WithDistance Word64 event 

Instances

Instances details
Foldable WithDistance # 
Instance details

Defined in Marconi.Cardano.Core.Extract.WithDistance

Methods

fold :: Monoid m => WithDistance m -> m Source #

foldMap :: Monoid m => (a -> m) -> WithDistance a -> m Source #

foldMap' :: Monoid m => (a -> m) -> WithDistance a -> m Source #

foldr :: (a -> b -> b) -> b -> WithDistance a -> b Source #

foldr' :: (a -> b -> b) -> b -> WithDistance a -> b Source #

foldl :: (b -> a -> b) -> b -> WithDistance a -> b Source #

foldl' :: (b -> a -> b) -> b -> WithDistance a -> b Source #

foldr1 :: (a -> a -> a) -> WithDistance a -> a Source #

foldl1 :: (a -> a -> a) -> WithDistance a -> a Source #

toList :: WithDistance a -> [a] Source #

null :: WithDistance a -> Bool Source #

length :: WithDistance a -> Int Source #

elem :: Eq a => a -> WithDistance a -> Bool Source #

maximum :: Ord a => WithDistance a -> a Source #

minimum :: Ord a => WithDistance a -> a Source #

sum :: Num a => WithDistance a -> a Source #

product :: Num a => WithDistance a -> a Source #

Traversable WithDistance # 
Instance details

Defined in Marconi.Cardano.Core.Extract.WithDistance

Methods

traverse :: Applicative f => (a -> f b) -> WithDistance a -> f (WithDistance b) Source #

sequenceA :: Applicative f => WithDistance (f a) -> f (WithDistance a) Source #

mapM :: Monad m => (a -> m b) -> WithDistance a -> m (WithDistance b) Source #

sequence :: Monad m => WithDistance (m a) -> m (WithDistance a) Source #

Functor WithDistance # 
Instance details

Defined in Marconi.Cardano.Core.Extract.WithDistance

Methods

fmap :: (a -> b) -> WithDistance a -> WithDistance b Source #

(<$) :: a -> WithDistance b -> WithDistance a Source #

Show event => Show (WithDistance event) # 
Instance details

Defined in Marconi.Cardano.Core.Extract.WithDistance

type Point (WithDistance event) # 
Instance details

Defined in Marconi.Cardano.Core.Extract.WithDistance

attachDistance :: BlockNo -> ChainTip -> event -> WithDistance event #

Attach the distance (in blocks) to the tip to an event

getEvent :: WithDistance event -> event #