pgp-wordlist-0.1: Translate between binary data and a human-readable collection of words.

Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Text.PgpWordlist.Internal.AltList

Contents

Description

Defines a type of list that containins two alternating element types.

Synopsis

Documentation

data AltList a b Source

List of elements of alternating element types.

Constructors

Nil 
Cons a (AltList b a) 

Instances

(Eq a, Eq b) => Eq (AltList a b) 
(Ord a, Ord b) => Ord (AltList a b) 
(Show a, Show b) => Show (AltList a b) 

Construction, deconstruction

fromList :: [a] -> AltList a a Source

Simple conversion function. Inverse of toList.

toList :: AltList a a -> [a] Source

Simple conversion function. Inverse of fromList.

Bifunctor

first :: (a -> a') -> AltList a b -> AltList a' b Source

Map over the first component of an AltList.

first f ≡ bimap f id

second :: (b -> b') -> AltList a b -> AltList a b' Source

Map over the second component of an AltList.

second g ≡ bimap id g

bimap :: (a -> a') -> (b -> b') -> AltList a b -> AltList a' b' Source

Map over the both components of an AltList.

bimap f g ≡ second g . first f

Bitraversable

bisequence :: Applicative f => AltList (f a) (f b) -> f (AltList a b) Source

Monomorphic bisequence.

bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> AltList a b -> f (AltList c d) Source

Monomorphic bitraverse.