util-0.1.17.1: Utilities

Safe HaskellSafe
LanguageHaskell2010

Util

Documentation

(&=&) :: Applicative p => (a -> p b) -> (a -> p c) -> a -> p (b, c) infixr 3 Source #

(*=*) :: Applicative p => (a1 -> p b1) -> (a2 -> p b2) -> (a1, a2) -> p (b1, b2) infixr 3 Source #

tripleK :: Applicative p => (a1 -> p b1) -> (a2 -> p b2) -> (a3 -> p b3) -> (a1, a2, a3) -> p (b1, b2, b3) Source #

(<||>) :: Applicative p => p Bool -> p Bool -> p Bool infixr 2 Source #

(<&&>) :: Applicative p => p Bool -> p Bool -> p Bool infixr 3 Source #

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

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

whileJust :: (Alternative f, Monad m) => m (Maybe a) -> (a -> m b) -> m (f b) Source #

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

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

unlessM :: Monad m => m Bool -> m () -> m () Source #

list :: b -> (a -> [a] -> b) -> [a] -> b Source #

list' :: b -> (NonEmpty a -> b) -> [a] -> b Source #

(∘) :: Category p => p b c -> p a b -> p a c infixr 9 Source #

(&) :: Category p => p a b -> p b c -> p a c infixr 9 Source #

(∘∘) :: (c -> d) -> (a -> b -> c) -> a -> b -> d infixr 9 Source #

compose2 :: (a' -> b' -> c) -> (a -> a') -> (b -> b') -> a -> b -> c Source #

compose3 :: (a' -> b' -> c' -> d) -> (a -> a') -> (b -> b') -> (c -> c') -> a -> b -> c -> d Source #

onn :: (a -> a -> a -> b) -> (c -> a) -> c -> c -> c -> b infixl 0 Source #

onnn :: (a -> a -> a -> a -> b) -> (c -> a) -> c -> c -> c -> c -> b infixl 0 Source #

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

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

þrd3 :: (a, b, c) -> c Source #

(₪) :: a -> (a -> b) -> b infixr 0 Source #

(<₪>) :: Functor f => f a -> (a -> b) -> f b infixl 4 Source #

replicate :: Alternative f => Natural -> a -> f a Source #

replicateA :: (Applicative p, Alternative f) => Natural -> p a -> p (f a) Source #

mtimesA :: (Applicative p, Semigroup a, Monoid a) => Natural -> p a -> p a Source #

newtype Ap p a Source #

Constructors

Ap 

Fields

Instances
Monad p => Monad (Ap p) Source # 
Instance details

Defined in Util

Methods

(>>=) :: Ap p a -> (a -> Ap p b) -> Ap p b Source #

(>>) :: Ap p a -> Ap p b -> Ap p b Source #

return :: a -> Ap p a Source #

fail :: String -> Ap p a Source #

Functor p => Functor (Ap p) Source # 
Instance details

Defined in Util

Methods

fmap :: (a -> b) -> Ap p a -> Ap p b Source #

(<$) :: a -> Ap p b -> Ap p a Source #

Applicative p => Applicative (Ap p) Source # 
Instance details

Defined in Util

Methods

pure :: a -> Ap p a Source #

(<*>) :: Ap p (a -> b) -> Ap p a -> Ap p b Source #

liftA2 :: (a -> b -> c) -> Ap p a -> Ap p b -> Ap p c Source #

(*>) :: Ap p a -> Ap p b -> Ap p b Source #

(<*) :: Ap p a -> Ap p b -> Ap p a Source #

Foldable p => Foldable (Ap p) Source # 
Instance details

Defined in Util

Methods

fold :: Monoid m => Ap p m -> m Source #

foldMap :: Monoid m => (a -> m) -> Ap p a -> m Source #

foldr :: (a -> b -> b) -> b -> Ap p a -> b Source #

foldr' :: (a -> b -> b) -> b -> Ap p a -> b Source #

foldl :: (b -> a -> b) -> b -> Ap p a -> b Source #

foldl' :: (b -> a -> b) -> b -> Ap p a -> b Source #

foldr1 :: (a -> a -> a) -> Ap p a -> a Source #

foldl1 :: (a -> a -> a) -> Ap p a -> a Source #

toList :: Ap p a -> [a] Source #

null :: Ap p a -> Bool Source #

length :: Ap p a -> Int Source #

elem :: Eq a => a -> Ap p a -> Bool Source #

maximum :: Ord a => Ap p a -> a Source #

minimum :: Ord a => Ap p a -> a Source #

sum :: Num a => Ap p a -> a Source #

product :: Num a => Ap p a -> a Source #

Traversable p => Traversable (Ap p) Source # 
Instance details

Defined in Util

Methods

traverse :: Applicative f => (a -> f b) -> Ap p a -> f (Ap p b) Source #

sequenceA :: Applicative f => Ap p (f a) -> f (Ap p a) Source #

mapM :: Monad m => (a -> m b) -> Ap p a -> m (Ap p b) Source #

sequence :: Monad m => Ap p (m a) -> m (Ap p a) Source #

Eq1 p => Eq1 (Ap p) Source # 
Instance details

Defined in Util

Methods

liftEq :: (a -> b -> Bool) -> Ap p a -> Ap p b -> Bool Source #

Ord1 p => Ord1 (Ap p) Source # 
Instance details

Defined in Util

Methods

liftCompare :: (a -> b -> Ordering) -> Ap p a -> Ap p b -> Ordering Source #

Read1 p => Read1 (Ap p) Source # 
Instance details

Defined in Util

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Ap p a) Source #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Ap p a] Source #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Ap p a) Source #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Ap p a] Source #

Show1 p => Show1 (Ap p) Source # 
Instance details

Defined in Util

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Ap p a -> ShowS Source #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Ap p a] -> ShowS Source #

Alternative p => Alternative (Ap p) Source # 
Instance details

Defined in Util

Methods

empty :: Ap p a Source #

(<|>) :: Ap p a -> Ap p a -> Ap p a Source #

some :: Ap p a -> Ap p [a] Source #

many :: Ap p a -> Ap p [a] Source #

MonadPlus p => MonadPlus (Ap p) Source # 
Instance details

Defined in Util

Methods

mzero :: Ap p a Source #

mplus :: Ap p a -> Ap p a -> Ap p a Source #

Bounded (p a) => Bounded (Ap p a) Source # 
Instance details

Defined in Util

Methods

minBound :: Ap p a Source #

maxBound :: Ap p a Source #

Enum (p a) => Enum (Ap p a) Source # 
Instance details

Defined in Util

Methods

succ :: Ap p a -> Ap p a Source #

pred :: Ap p a -> Ap p a Source #

toEnum :: Int -> Ap p a Source #

fromEnum :: Ap p a -> Int Source #

enumFrom :: Ap p a -> [Ap p a] Source #

enumFromThen :: Ap p a -> Ap p a -> [Ap p a] Source #

enumFromTo :: Ap p a -> Ap p a -> [Ap p a] Source #

enumFromThenTo :: Ap p a -> Ap p a -> Ap p a -> [Ap p a] Source #

Eq (p a) => Eq (Ap p a) Source # 
Instance details

Defined in Util

Methods

(==) :: Ap p a -> Ap p a -> Bool Source #

(/=) :: Ap p a -> Ap p a -> Bool Source #

Ord (p a) => Ord (Ap p a) Source # 
Instance details

Defined in Util

Methods

compare :: Ap p a -> Ap p a -> Ordering Source #

(<) :: Ap p a -> Ap p a -> Bool Source #

(<=) :: Ap p a -> Ap p a -> Bool Source #

(>) :: Ap p a -> Ap p a -> Bool Source #

(>=) :: Ap p a -> Ap p a -> Bool Source #

max :: Ap p a -> Ap p a -> Ap p a Source #

min :: Ap p a -> Ap p a -> Ap p a Source #

Read (p a) => Read (Ap p a) Source # 
Instance details

Defined in Util

Show (p a) => Show (Ap p a) Source # 
Instance details

Defined in Util

Methods

showsPrec :: Int -> Ap p a -> ShowS Source #

show :: Ap p a -> String Source #

showList :: [Ap p a] -> ShowS Source #

(Applicative p, Semigroup a) => Semigroup (Ap p a) Source # 
Instance details

Defined in Util

Methods

(<>) :: Ap p a -> Ap p a -> Ap p a Source #

sconcat :: NonEmpty (Ap p a) -> Ap p a Source #

stimes :: Integral b => b -> Ap p a -> Ap p a Source #

(Applicative p, Semigroup a, Monoid a) => Monoid (Ap p a) Source # 
Instance details

Defined in Util

Methods

mempty :: Ap p a Source #

mappend :: Ap p a -> Ap p a -> Ap p a Source #

mconcat :: [Ap p a] -> Ap p a Source #

(!!?) :: Foldable f => f a -> Natural -> Maybe a Source #

intercalate :: Semigroup a => a -> NonEmpty a -> a Source #

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

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

traverse2 :: (Traversable t, Applicative t, Applicative p) => (a -> b -> p c) -> t a -> t b -> p (t c) Source #

traverse3 :: (Traversable t, Applicative t, Applicative p) => (a -> b -> c -> p d) -> t a -> t b -> t c -> p (t d) Source #

foldMap2 :: (Foldable t, Applicative t, Monoid z) => (a -> b -> z) -> t a -> t b -> z Source #

foldMap3 :: (Foldable t, Applicative t, Monoid z) => (a -> b -> c -> z) -> t a -> t b -> t c -> z Source #

uncurry3 :: (a -> b -> c -> d) -> (a, b, c) -> d Source #

uncurry4 :: (a -> b -> c -> d -> e) -> (a, b, c, d) -> e Source #

curry3 :: ((a, b, c) -> d) -> a -> b -> c -> d Source #

curry4 :: ((a, b, c, d) -> e) -> a -> b -> c -> d -> e Source #

(∈) :: (Eq a, Foldable f) => a -> f a -> Bool infix 4 Source #

(∉) :: (Eq a, Foldable f) => a -> f a -> Bool infix 4 Source #

maximumBy :: Foldable f => (a -> a -> Ordering) -> f a -> Maybe a Source #

minimumBy :: Foldable f => (a -> a -> Ordering) -> f a -> Maybe a Source #

foldMapA :: (Applicative p, Monoid b, Foldable f) => (a -> p b) -> f a -> p b Source #

altMap :: (Alternative p, Foldable f) => (a -> p b) -> f a -> p b Source #

iterateM :: Monad m => Natural -> (a -> m a) -> a -> m (NonEmpty a) Source #

loopM :: MonadFix m => (a -> m (a, b)) -> m b Source #

(<|) :: Alternative f => a -> f a -> f a infixl 3 Source #

(|>) :: Alternative f => f a -> a -> f a infixl 3 Source #

count :: (Traversable f, Enum n) => f a -> f (n, a) Source #

countFrom :: (Traversable f, Enum n) => n -> f a -> f (n, a) Source #

some :: Alternative p => p a -> p (NonEmpty a) Source #