Data.Strict.Tuple

strict-0.3.2: Strict data types and String IO.

Copyright | (c) 2006-2007 Roman Leshchinskiy
License | BSD-style (see the file LICENSE)
Maintainer | Roman Leshchinskiy <rl@cse.unsw.edu.au>
Stability | experimental
Portability | portable
Safe Haskell | None
Language | Haskell98

Data.Strict.Tuple

Description

Strict pairs.

Same as regular Haskell pairs, but `(x :*: _|_) = (_|_ :*: y) = _|_`

Synopsis

- data Pair a b = !a :!: !b
- type (:!:) = Pair
- fst :: Pair a b -> a
- snd :: Pair a b -> b
- curry :: (Pair a b -> c) -> a -> b -> c
- uncurry :: (a -> b -> c) -> Pair a b -> c

# Documentation

data Pair a b #

The type of strict pairs.

Constructors

!a :!: !b infixl 2 |

Instances

(Bounded a, Bounded b) => Bounded (Pair a b) # |
Methods minBound :: Pair a b # maxBound :: Pair a b #
(Eq a, Eq b) => Eq (Pair a b) # |
Methods (==) :: Pair a b -> Pair a b -> Bool # (/=) :: Pair a b -> Pair a b -> Bool #
(Ord a, Ord b) => Ord (Pair a b) # |
Methods compare :: Pair a b -> Pair a b -> Ordering # (<) :: Pair a b -> Pair a b -> Bool # (<=) :: Pair a b -> Pair a b -> Bool # (>) :: Pair a b -> Pair a b -> Bool # (>=) :: Pair a b -> Pair a b -> Bool # max :: Pair a b -> Pair a b -> Pair a b # min :: Pair a b -> Pair a b -> Pair a b #
(Read a, Read b) => Read (Pair a b) # |
Methods readsPrec :: Int -> ReadS (Pair a b) # readList :: ReadS [Pair a b] # readPrec :: ReadPrec (Pair a b) # readListPrec :: ReadPrec [Pair a b] #
(Show a, Show b) => Show (Pair a b) # |
Methods showsPrec :: Int -> Pair a b -> ShowS # show :: Pair a b -> String # showList :: [Pair a b] -> ShowS #
(Ix a, Ix b) => Ix (Pair a b) # |
Methods range :: (Pair a b, Pair a b) -> [Pair a b] # index :: (Pair a b, Pair a b) -> Pair a b -> Int # unsafeIndex :: (Pair a b, Pair a b) -> Pair a b -> Int inRange :: (Pair a b, Pair a b) -> Pair a b -> Bool # rangeSize :: (Pair a b, Pair a b) -> Int # unsafeRangeSize :: (Pair a b, Pair a b) -> Int

type (:!:) = Pair infixl 2 #

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.