sdp-0.2: Simple Data Processing
Copyright(c) Andrey Mulik 2019
LicenseBSD-style
Maintainerwork.a.mulik@gmail.com
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

SDP.SafePrelude

Description

SDP.SafePrelude module re-exports common Prelude definitions except those overridden in this library and its extensions (e.g. sdp-io).

In addition, this module re-exports the most common definitions from other base and sdp modules (Control.Applicative, Data.Bufunctor, SDP.Estimate, etc.) and some useful combinators that were used in this library and may be useful to its users.

Import Prelude without conflicting functions, may require additional imports for functions overridden in other modules:

     import Prelude ()
     import SDP.SafePrelude
   
Synopsis

Documentation

(?) :: Bool -> a -> a -> a infixr 1 Source #

Ternary operator.

(odd 1 ? "is True" $ "is False") == "is True"

(?+) :: (a -> Bool) -> (a -> b) -> a -> Maybe b infixl 8 Source #

p ?+ f $ a returns Just (f a) if (p a) and Nothing otherwise.

(?-) :: (a -> Bool) -> (a -> b) -> a -> Maybe b infixl 8 Source #

p ?- f $ a returns Nothing if (p a) and Just (f a) otherwise.

(?:) :: Maybe a -> [a] -> [a] Source #

Prepends Maybe to list.

(+?) :: a -> Maybe a -> a Source #

Short version of fromMaybe.

(...) :: (c -> d) -> (a -> b -> c) -> a -> b -> d infixr 0 Source #

(...) = (.) . (.).

(?^) :: Monad m => m Bool -> m a -> m a -> m a infixr 1 Source #

Lifted (?).

(<=<<) :: Monad m => (c -> m d) -> (a -> b -> m c) -> a -> b -> m d Source #

Monadic version of (...).

(>>=>) :: Monad m => (a -> b -> m c) -> (c -> m d) -> a -> b -> m d Source #

Monadic vesion of (...) with reversed arguments.

(>>=<<) :: Monad m => m a -> m b -> (a -> b -> m c) -> m c Source #

ma >>=<< mb is composition of join and liftM2.

liftA4 :: Applicative t => (a -> b -> c -> d -> e) -> t a -> t b -> t c -> t d -> t e Source #

Very useful combinator.

liftA5 :: Applicative t => (a -> b -> c -> d -> e -> f) -> t a -> t b -> t c -> t d -> t e -> t f Source #

Very very useful combinator

liftA6 :: Applicative t => (a -> b -> c -> d -> e -> f -> g) -> t a -> t b -> t c -> t d -> t e -> t f -> t g Source #

An even more useful combinator.

liftM6 :: Monad m => (a -> b -> c -> d -> e -> f -> g) -> m a -> m b -> m c -> m d -> m e -> m f -> m g Source #

See liftA6.

stToMIO :: MonadIO io => ST RealWorld e -> io e Source #

stToMIO is just liftIO . stToIO.