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

Copyright(c) 2006-2007 Roman Leshchinskiy (c) 2013 Simon Meier
LicenseBSD-style (see the file LICENSE)
MaintainerSimon Meier <iridcode@gmail.com>
Stabilityexperimental
PortabilityGHC
Safe HaskellNone
LanguageHaskell98

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 infixl 2 

Instances

(Bounded a, Bounded b) => Bounded (Pair a b) 
(Eq a, Eq b) => Eq (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) 
type Rep (Pair a b) 
type Index (Pair a b) = Int 

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 a Source

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.