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

Safe HaskellSafe
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
Bifunctor AltList Source # 
Instance details

Defined in Data.Text.PgpWordlist.Internal.AltList

Methods

bimap :: (a -> b) -> (c -> d) -> AltList a c -> AltList b d #

first :: (a -> b) -> AltList a c -> AltList b c #

second :: (b -> c) -> AltList a b -> AltList a c #

(Eq a, Eq b) => Eq (AltList a b) Source # 
Instance details

Defined in Data.Text.PgpWordlist.Internal.AltList

Methods

(==) :: AltList a b -> AltList a b -> Bool #

(/=) :: AltList a b -> AltList a b -> Bool #

(Ord a, Ord b) => Ord (AltList a b) Source # 
Instance details

Defined in Data.Text.PgpWordlist.Internal.AltList

Methods

compare :: AltList a b -> AltList a b -> Ordering #

(<) :: AltList a b -> AltList a b -> Bool #

(<=) :: AltList a b -> AltList a b -> Bool #

(>) :: AltList a b -> AltList a b -> Bool #

(>=) :: AltList a b -> AltList a b -> Bool #

max :: AltList a b -> AltList a b -> AltList a b #

min :: AltList a b -> AltList a b -> AltList a b #

(Show a, Show b) => Show (AltList a b) Source # 
Instance details

Defined in Data.Text.PgpWordlist.Internal.AltList

Methods

showsPrec :: Int -> AltList a b -> ShowS #

show :: AltList a b -> String #

showList :: [AltList a b] -> ShowS #

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.