util-0.1.17.0: 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 #

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

return :: a -> Ap p a #

fail :: String -> Ap p a #

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

Defined in Util

Methods

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

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

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

Defined in Util

Methods

pure :: a -> Ap p a #

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

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

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

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

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

Defined in Util

Methods

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

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

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

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

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

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

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

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

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

null :: Ap p a -> Bool #

length :: Ap p a -> Int #

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

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

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

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

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

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) #

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

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

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

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

Defined in Util

Methods

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

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

Defined in Util

Methods

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

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

Defined in Util

Methods

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

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

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

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

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

Defined in Util

Methods

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

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

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

Defined in Util

Methods

empty :: Ap p a #

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

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

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

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

Defined in Util

Methods

mzero :: Ap p a #

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

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

Defined in Util

Methods

minBound :: Ap p a #

maxBound :: Ap p a #

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

Defined in Util

Methods

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

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

toEnum :: Int -> Ap p a #

fromEnum :: Ap p a -> Int #

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

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

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

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

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

Defined in Util

Methods

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

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

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

Defined in Util

Methods

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

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

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

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

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

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

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

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

Defined in Util

Methods

readsPrec :: Int -> ReadS (Ap p a) #

readList :: ReadS [Ap p a] #

readPrec :: ReadPrec (Ap p a) #

readListPrec :: ReadPrec [Ap p a] #

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

Defined in Util

Methods

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

show :: Ap p a -> String #

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

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

Defined in Util

Methods

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

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

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

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

Defined in Util

Methods

mempty :: Ap p a #

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

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

(!!?) :: 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 #