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

Copyright (c) 2006-2007 Roman Leshchinskiy(c) 2013 Simon Meier BSD-style (see the file LICENSE) Simon Meier experimental GHC None Haskell98

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

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

 Source # Methodsbitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> Pair a b -> f (Pair c d) # Source # Methodsbifold :: 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 # Source # Methodsbimap :: (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 # Source # Methodsswapped :: (Profunctor p, Functor f) => p (Pair b a) (f (Pair d c)) -> p (Pair a b) (f (Pair c d)) # Functor (Pair e) Source # Methodsfmap :: (a -> b) -> Pair e a -> Pair e b #(<\$) :: a -> Pair e b -> Pair e a # Foldable (Pair e) Source # Methodsfold :: 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 # Source # Methodstraverse :: 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 # Methodsgfoldl :: (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 Typestype Rep (Pair a b) :: * -> * # Methodsfrom :: Pair a b -> Rep (Pair a b) x #to :: Rep (Pair a b) x -> Pair a b # (Semigroup a, Semigroup b) => Semigroup (Pair a b) Source # Methods(<>) :: Pair a b -> Pair a b -> Pair a b #sconcat :: NonEmpty (Pair a b) -> Pair a b #stimes :: Integral b => b -> Pair a b -> Pair a b # (Monoid a, Monoid b) => Monoid (Pair a b) Source # Methodsmempty :: 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 # Methodsarbitrary :: Gen (Pair a b) #shrink :: Pair a b -> [Pair a b] # (Hashable a, Hashable b) => Hashable (Pair a b) Source # MethodshashWithSalt :: Int -> Pair a b -> Int #hash :: Pair a b -> Int # (ToJSON a, ToJSON b) => ToJSON (Pair a b) Source # MethodstoJSON :: 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 # MethodsparseJSON :: Value -> Parser (Pair a b) #parseJSONList :: Value -> Parser [Pair a b] # (Binary a, Binary b) => Binary (Pair a b) Source # Methodsput :: Pair a b -> Put #get :: Get (Pair a b) #putList :: [Pair a b] -> Put # (NFData a, NFData b) => NFData (Pair a b) Source # Methodsrnf :: Pair a b -> () # Strict (a, b) (Pair a b) Source # Methodsstrict :: Iso' (a, b) (Pair a b) # ((~) * a a', (~) * b b') => Each (Pair a a') (Pair b b') a b Source # Methodseach :: 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' #