strict-base-types-0.6.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

Contents

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 b, Bounded a) => Bounded (Pair a b) 

Methods

minBound :: Pair a b #

maxBound :: Pair a b #

(Eq b, Eq a) => Eq (Pair a b) 

Methods

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

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

(Ord b, Ord a) => 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 b, Read a) => 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 b, Show a) => Show (Pair a b) 

Methods

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

show :: Pair a b -> String #

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

(Ix b, Ix a) => 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 Rep (Pair a b) # 
type Rep (Pair a b) = D1 * (MetaData "Pair" "Data.Strict.Tuple" "strict-0.3.2-1XGU2LPrqRE7Qw1PnSNhY5" False) (C1 * (MetaCons ":!:" (InfixI LeftAssociative 9) False) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * a)) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * b))))
type Index (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.

Orphan instances

Bitraversable Pair Source # 

Methods

bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> Pair a b -> f (Pair c d) #

Bifoldable Pair Source # 

Methods

bifold :: Monoid m => Pair m m -> m #

bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> Pair a b -> m #

bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> Pair a b -> c #

bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> Pair a b -> c #

Bifunctor Pair Source # 

Methods

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

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

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

Swapped Pair Source # 

Methods

swapped :: (Profunctor p, Functor f) => p (Pair b a) (f (Pair d c)) -> p (Pair a b) (f (Pair c d)) #

Functor (Pair e) Source # 

Methods

fmap :: (a -> b) -> Pair e a -> Pair e b #

(<$) :: a -> Pair e b -> Pair e a #

Foldable (Pair e) Source # 

Methods

fold :: Monoid m => Pair e m -> m #

foldMap :: Monoid m => (a -> m) -> Pair e a -> m #

foldr :: (a -> b -> b) -> b -> Pair e a -> b #

foldr' :: (a -> b -> b) -> b -> Pair e a -> b #

foldl :: (b -> a -> b) -> b -> Pair e a -> b #

foldl' :: (b -> a -> b) -> b -> Pair e a -> b #

foldr1 :: (a -> a -> a) -> Pair e a -> a #

foldl1 :: (a -> a -> a) -> Pair e a -> a #

toList :: Pair e a -> [a] #

null :: Pair e a -> Bool #

length :: Pair e a -> Int #

elem :: Eq a => a -> Pair e a -> Bool #

maximum :: Ord a => Pair e a -> a #

minimum :: Ord a => Pair e a -> a #

sum :: Num a => Pair e a -> a #

product :: Num a => Pair e a -> a #

Traversable (Pair e) Source # 

Methods

traverse :: Applicative f => (a -> f b) -> Pair e a -> f (Pair e b) #

sequenceA :: Applicative f => Pair e (f a) -> f (Pair e a) #

mapM :: Monad m => (a -> m b) -> Pair e a -> m (Pair e b) #

sequence :: Monad m => Pair e (m a) -> m (Pair e a) #

(Data a, Data b) => Data (Pair a b) Source # 

Methods

gfoldl :: (forall d c. Data d => c (d -> c) -> d -> c c) -> (forall g. g -> c g) -> Pair a b -> c (Pair a b) #

gunfold :: (forall c r. Data c => c (c -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Pair a b) #

toConstr :: Pair a b -> Constr #

dataTypeOf :: Pair a b -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Pair a b)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Pair a b)) #

gmapT :: (forall c. Data c => c -> c) -> Pair a b -> Pair a b #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Pair a b -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Pair a b -> r #

gmapQ :: (forall d. Data d => d -> u) -> Pair a b -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Pair a b -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Pair a b -> m (Pair a b) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Pair a b -> m (Pair a b) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Pair a b -> m (Pair a b) #

Generic (Pair a b) Source # 

Associated Types

type Rep (Pair a b) :: * -> * #

Methods

from :: Pair a b -> Rep (Pair a b) x #

to :: Rep (Pair a b) x -> Pair a b #

(Monoid a, Monoid b) => Monoid (Pair a b) Source # 

Methods

mempty :: Pair a b #

mappend :: Pair a b -> Pair a b -> Pair a b #

mconcat :: [Pair a b] -> Pair a b #

(Arbitrary a, Arbitrary b) => Arbitrary (Pair a b) Source # 

Methods

arbitrary :: Gen (Pair a b) #

shrink :: Pair a b -> [Pair a b] #

(Hashable a, Hashable b) => Hashable (Pair a b) Source # 

Methods

hashWithSalt :: Int -> Pair a b -> Int #

hash :: Pair a b -> Int #

(ToJSON a, ToJSON b) => ToJSON (Pair a b) Source # 

Methods

toJSON :: Pair a b -> Value #

toEncoding :: Pair a b -> Encoding #

toJSONList :: [Pair a b] -> Value #

toEncodingList :: [Pair a b] -> Encoding #

(FromJSON a, FromJSON b) => FromJSON (Pair a b) Source # 

Methods

parseJSON :: Value -> Parser (Pair a b) #

parseJSONList :: Value -> Parser [Pair a b] #

(Binary a, Binary b) => Binary (Pair a b) Source # 

Methods

put :: Pair a b -> Put #

get :: Get (Pair a b) #

putList :: [Pair a b] -> Put #

(NFData a, NFData b) => NFData (Pair a b) Source # 

Methods

rnf :: Pair a b -> () #

Strict (a, b) (Pair a b) Source # 

Methods

strict :: Iso' (a, b) (Pair a b) #

((~) * a a', (~) * b b') => Each (Pair a a') (Pair b b') a b Source # 

Methods

each :: Traversal (Pair a a') (Pair b b') a b #

Field1 (Pair a b) (Pair a' b) a a' Source # 

Methods

_1 :: Lens (Pair a b) (Pair a' b) a a' #

Field2 (Pair a b) (Pair a b') b b' Source # 

Methods

_2 :: Lens (Pair a b) (Pair a b') b b' #