-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Strict variants of the types provided in base. -- -- Since version 0.7 the functionality in this package have been merged -- into strict, aeson and `quickcheck-instances` packages, -- and lens functionality moved into `strict-lens` package. @package strict-base-types @version 0.7 -- | The strict variant of the standard Haskell Either type and the -- corresponding variants of the functions from Data.Either. -- -- Note that the strict Either type is not an applicative functor, -- and therefore also no monad. The reasons are the same as the ones for -- the strict Maybe type, which are explained in -- Data.Maybe.Strict. module Data.Either.Strict -- | The strict choice type. data Either a b Left :: !a -> Either a b Right :: !b -> Either a b -- | Yields True iff the argument is of the form Right _. isRight :: () => Either a b -> Bool -- | Yields True iff the argument is of the form Left _. isLeft :: () => Either a b -> Bool -- | Case analysis: if the value is Left a, apply the first -- function to a; if it is Right b, apply the -- second function to b. either :: () => (a -> c) -> (b -> c) -> Either a b -> c -- | Analogous to lefts in Data.Either. lefts :: () => [Either a b] -> [a] -- | Analogous to rights in Data.Either. rights :: () => [Either a b] -> [b] -- | Analogous to partitionEithers in Data.Either. partitionEithers :: () => [Either a b] -> ([a], [b]) -- | Analogous to _Left in Control.Lens.Prism. _Left :: () => Prism (Either a c) (Either b c) a b -- | Analogous to _Right in Control.Lens.Prism. _Right :: () => Prism (Either c a) (Either c b) a b -- | The strict variant of the standard Haskell Maybe type and the -- corresponding variants of the functions from Data.Maybe. -- -- Note that in contrast to the standard lazy Maybe type, the -- strict Maybe type is not an applicative functor, and therefore -- also not a monad. The problem is the homomorphism law, which -- states that -- --
--   pure f <*> pure x = pure (f x)  -- must hold for all f
--   
-- -- This law does not hold for the expected applicative functor instance -- of Maybe, as this instance does not satisfy pure f -- <*> pure _|_ = pure (f _|_) for f = const. module Data.Maybe.Strict -- | The type of strict optional values. data Maybe a Nothing :: Maybe a Just :: !a -> Maybe a -- | Given a default value, a function and a Maybe value, yields the -- default value if the Maybe value is Nothing and applies -- the function to the value stored in the Just otherwise. maybe :: () => b -> (a -> b) -> Maybe a -> b -- | Yields True iff the argument is of the form Just _. isJust :: () => Maybe a -> Bool -- | Yields True iff the argument is Nothing. isNothing :: () => Maybe a -> Bool -- | Extracts the element out of a Just and throws an error if the -- argument is Nothing. fromJust :: () => Maybe a -> a -- | Given a default value and a Maybe, yield the default value if -- the Maybe argument is Nothing and extract the value out -- of the Just otherwise. fromMaybe :: () => a -> Maybe a -> a -- | Analogous to listToMaybe in Data.Maybe. listToMaybe :: () => [a] -> Maybe a -- | Analogous to maybeToList in Data.Maybe. maybeToList :: () => Maybe a -> [a] -- | Analogous to catMaybes in Data.Maybe. catMaybes :: () => [Maybe a] -> [a] -- | Analogous to mapMaybe in Data.Maybe. mapMaybe :: () => (a -> Maybe b) -> [a] -> [b] -- | Analogous to _Just in Control.Lens.Prism _Just :: () => Prism (Maybe a) (Maybe b) a b -- | Analogous to _Nothing in Control.Lens.Prism _Nothing :: () => Prism' (Maybe a) () -- | The strict variant of the standard Haskell pairs and the corresponding -- variants of the functions from Data.Tuple. module Data.Tuple.Strict -- | The type of strict pairs. data Pair a b (:!:) :: !a -> !b -> Pair a b infix 2 :!: -- | Extract the first component of a strict pair. fst :: () => Pair a b -> a -- | Extract the second component of a strict pair. snd :: () => Pair a b -> b -- | Curry a function on strict pairs. curry :: () => (Pair a b -> c) -> a -> b -> c -- | Convert a curried function to a function on strict pairs. uncurry :: () => (a -> b -> c) -> Pair a b -> c -- | Analagous to swap from Data.Tuple swap :: () => Pair a b -> Pair b a -- | Zip for strict pairs (defined with zipWith). zip :: () => [a] -> [b] -> [Pair a b] -- | Unzip for stict pairs into a (lazy) pair of lists. unzip :: () => [Pair a b] -> ([a], [b])