ouroboros-consensus-0.18.0.0: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ouroboros.Consensus.Util.HList

Description

Heterogeneous lists

Intended for qualified import

Synopsis

Basic definitions

type family All c as ∷ Constraint where ... Source #

Equations

All c '[] = () 
All c (a ': as) = (c a, All c as) 

data HList ∷ [Type] → Type where Source #

Constructors

NilHList '[] 
(:*) ∷ a → HList as → HList (a ': as) infixr 9 

Instances

Instances details
All Show as ⇒ Show (HList as) Source # 
Instance details

Defined in Ouroboros.Consensus.Util.HList

Methods

showsPrecIntHList as → ShowS #

showHList as → String #

showList ∷ [HList as] → ShowS #

(IsList as, All Eq as) ⇒ Eq (HList as) Source # 
Instance details

Defined in Ouroboros.Consensus.Util.HList

Methods

(==)HList as → HList as → Bool #

(/=)HList as → HList as → Bool #

(IsList as, All Eq as, All Ord as) ⇒ Ord (HList as) Source # 
Instance details

Defined in Ouroboros.Consensus.Util.HList

Methods

compareHList as → HList as → Ordering #

(<)HList as → HList as → Bool #

(<=)HList as → HList as → Bool #

(>)HList as → HList as → Bool #

(>=)HList as → HList as → Bool #

maxHList as → HList as → HList as #

minHList as → HList as → HList as #

All Condense as ⇒ Condense (HList as) Source # 
Instance details

Defined in Ouroboros.Consensus.Util.Condense

Methods

condenseHList as → String Source #

Folding

collapse ∷ ∀ c as b proxy. All c as ⇒ proxy c → (∀ a. c a ⇒ a → b) → HList as → [b] Source #

foldMap ∷ ∀ c as b proxy. (All c as, Monoid b) ⇒ proxy c → (∀ a. c a ⇒ a → b) → HList as → b Source #

foldl ∷ ∀ c as b proxy. All c as ⇒ proxy c → (∀ a. c a ⇒ b → a → b) → b → HList as → b Source #

foldlM ∷ ∀ c as m b proxy. (All c as, Monad m) ⇒ proxy c → (∀ a. c a ⇒ b → a → m b) → b → HList as → m b Source #

foldr ∷ ∀ c as b proxy. All c as ⇒ proxy c → (∀ a. c a ⇒ a → b → b) → b → HList as → b Source #

repeatedly ∷ ∀ c as b proxy. All c as ⇒ proxy c → (∀ a. c a ⇒ a → b → b) → HList as → b → b Source #

Apply function repeatedly for all elements of the list

repeatedly p = flip . foldl p . flip

repeatedlyM ∷ ∀ c as b proxy m. (Monad m, All c as) ⇒ proxy c → (∀ a. c a ⇒ a → b → m b) → HList as → b → m b Source #

Singletons

class IsList (xs ∷ [Type]) where Source #

Methods

isListSList xs Source #

Instances

Instances details
IsList ('[] ∷ [Type]) Source # 
Instance details

Defined in Ouroboros.Consensus.Util.HList

Methods

isListSList '[] Source #

IsList as ⇒ IsList (a ': as) Source # 
Instance details

Defined in Ouroboros.Consensus.Util.HList

Methods

isListSList (a ': as) Source #

data SList ∷ [Type] → Type Source #

n-ary functions

type family Fn as b where ... Source #

Equations

Fn '[] b = b 
Fn (a ': as) b = a → Fn as b 

afterFnSList as → (b → c) → Fn as b → Fn as c Source #

applyFnFn as b → HList as → b Source #