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

Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Text.PgpWordlist.Internal.AltList

Contents

Description

A type of list that contains two alternating element types.

Synopsis

Documentation

data AltList a b Source

List of elements of alternating element types.

Constructors

Nil 
a :<> (AltList b a) infixr 5 

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 every other element of an AltList, starting with the first entry.

first f ≡ bimap f id

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

Map over every other element of an AltList, starting with the second entry.

second g ≡ bimap id g

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

Map over the both types of entries of an AltList.

bimap f g ≡ second g . first f

Bitraversable

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

The Bifunctor analogon to sequenceA.

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

The Bifunctor analogon to traverse.