strict-base-types-0.2.1: Strict variants of the types provided in base.

PortabilityGHC
Stabilityexperimental
MaintainerSimon Meier <iridcode@gmail.com>
Safe HaskellNone

Data.Tuple.Strict

Description

The strict variant of the standard Haskell pairs and the corresponding variants of the functions from Data.Tuple.

Synopsis

Documentation

data Pair a b

The type of strict pairs.

Constructors

!a :!: !b 

Instances

Typeable2 Pair 
Bitraversable Pair 
Bifunctor Pair 
Bifoldable Pair 
Swapped Pair 
(Applicative f, ~ * a a', ~ * b b') => Each f (Pair a a') (Pair b b') a b 
(Bounded a, Bounded b) => Bounded (Pair a b) 
(Eq a, Eq b) => Eq (Pair a b) 
(Data a, Data b) => Data (Pair a b) 
(Ord a, Ord b) => Ord (Pair a b) 
(Read a, Read b) => Read (Pair a b) 
(Show a, Show b) => Show (Pair a b) 
(Ix a, Ix b) => Ix (Pair a b) 
Generic (Pair a b) 
(Arbitrary a, Arbitrary b) => Arbitrary (Pair a b) 
(ToJSON a, ToJSON b) => ToJSON (Pair a b) 
(FromJSON a, FromJSON b) => FromJSON (Pair a b) 
(Monoid a, Monoid b) => Monoid (Pair a b) 
(Binary a, Binary b) => Binary (Pair a b) 
(NFData a, NFData b) => NFData (Pair a b) 
Strict (a, b) (Pair a b) 
Field1 (Pair a b) (Pair a' b) a a' 
Field2 (Pair a b) (Pair a b') b b' 

fst :: Pair a b -> a

Extract the first component of a strict pair.

snd :: Pair a b -> b

Extract the second component of a strict pair.

curry :: (Pair a b -> c) -> a -> b -> c

Curry a function on strict pairs.

uncurry :: (a -> b -> c) -> Pair a b -> c

Convert a curried function to a function on strict pairs.

swap :: Pair a b -> Pair b aSource

Analagous to swap from Data.Tuple

zip :: [a] -> [b] -> [Pair a b]Source

Zip for strict pairs (defined with zipWith).

unzip :: [Pair a b] -> ([a], [b])Source

Unzip for stict pairs into a (lazy) pair of lists.