databrary-1: Databrary

Safe HaskellSafe
LanguageHaskell2010

Ops

Description

FIXME: There is a lot of duplication of standard library tools in here.

Synopsis

Documentation

useWhen :: Alternative f => a -> Bool -> f a Source #

flip '(?>)'

thenUse :: Alternative f => Bool -> a -> f a Source #

'($>)' . guard

unlessUse :: Alternative f => Bool -> a -> f a Source #

'(?>)' . not

thenReturn :: (Applicative m, Alternative f) => Bool -> m a -> m (f a) Source #

liftM . (?>)

unlessReturn :: (Applicative m, Alternative f) => Bool -> m a -> m (f a) Source #

'(?$>)' . not

fromMaybeM :: Monad m => m a -> Maybe a -> m a Source #

orElseM :: Monad m => Maybe a -> m (Maybe a) -> m (Maybe a) infixl 3 Source #

flatMapM :: Monad m => (a -> m (Maybe b)) -> Maybe a -> m (Maybe b) Source #

groupTuplesBy :: (a -> a -> Bool) -> [(a, b)] -> [(a, [b])] Source #

mergeBy :: (a -> a -> Ordering) -> [a] -> [a] -> [a] Source #

Merge two ordered lists using the given predicate, removing EQ "duplicates" (left-biased)