hydrogen-0.3.0.0: An alternate Prelude

Safe HaskellNone
LanguageHaskell2010

H.Prelude

Synopsis

Documentation

module Data.Bool

module Data.Char

module Data.List

module Data.Map

module Data.Maybe

module Data.Ord

module Data.Ratio

module Data.Set

module Data.Text

module Data.Tuple

module Prelude

show :: Show a => a -> Text Source

read :: Read a => Text -> Maybe a Source

error :: Text -> a Source

whenJust :: Monad m => Maybe a -> (a -> m ()) -> m () Source

If the input is Just, do a monadic action on the value

onFst :: (a -> c) -> (a, b) -> (c, b) Source

onSnd :: (b -> c) -> (a, b) -> (a, c) Source

onFstF :: Functor f => (a -> f c) -> (a, b) -> f (c, b) Source

onSndF :: Functor f => (b -> f c) -> (a, b) -> f (a, c) Source

lift2 :: (MonadTrans t, MonadTrans u, Monad m, Monad (u m)) => m a -> t (u m) a Source

lift3 :: (MonadTrans t, MonadTrans u, MonadTrans v, Monad m, Monad (u m), Monad (t (u m))) => m a -> v (t (u m)) a Source

lift4 :: (MonadTrans t, MonadTrans u, MonadTrans v, MonadTrans w, Monad m, Monad (u m), Monad (t (u m)), Monad (v (t (u m)))) => m a -> w (v (t (u m))) a Source

modifyM :: Monad m => (s -> m s) -> StateT s m () Source

Modify the state of a StateT using a monadic action of the inner monad.

minimumByM :: Monad m => (a -> a -> m Ordering) -> [a] -> m a Source

Find the minimum element of a list using a monadic comparison action.

data Proxy a Source

Constructors

Proxy 

asProxied :: a -> Proxy a -> a infix 8 Source

eitherAlt :: Alternative f => f a -> f b -> f (Either a b) infixl 3 Source

Like |, but the operands may have different value types, with Either providing a union of those two types in the result

sequenceWhileJust :: Monad m => [m (Maybe a)] -> m [a] Source

Sequence a list of actions that return Maybes, stopping at the first Nothing

headView :: [a] -> Maybe (a, [a]) Source

Deconstruct a list into its head and tail

fst3 :: (a, b, c) -> a Source

Get the first element of a triple

snd3 :: (a, b, c) -> b Source

Get the second element of a triple

thd3 :: (a, b, c) -> c Source

Get the third element of a triple

unionWithM :: (Ord k, Monad m) => (a -> a -> m a) -> Map k a -> Map k a -> m (Map k a) Source

Union two maps, with a monadic action for merging duplicates

whenM :: Monad m => m Bool -> m () -> m () Source

Like when, but the condition is also a monadic action

traceVal :: Show a => a -> a Source

setCatMaybes :: Ord a => Set (Maybe a) -> Set a Source

setSequence :: (Ord a, Applicative f) => Set (f a) -> f (Set a) Source

onLeft :: (a -> c) -> Either a b -> Either c b Source

onRight :: (b -> c) -> Either a b -> Either a c Source

whenJustM :: Monad m => m (Maybe a) -> (a -> m ()) -> m () Source