skulk-0.1.3.0: Eclectic collection of utility functions

Safe HaskellSafe
LanguageHaskell2010

Skulk.Deep

Description

Collection of convenience functions for dealing with nested applicativemonadicetc structures.

Synopsis

Documentation

newtype Deep a b c Source #

Constructors

Deep 

Fields

Instances

(Monad a, Monad b, Traversable b) => Monad (Deep a b) Source # 

Methods

(>>=) :: Deep a b a -> (a -> Deep a b b) -> Deep a b b #

(>>) :: Deep a b a -> Deep a b b -> Deep a b b #

return :: a -> Deep a b a #

fail :: String -> Deep a b a #

(Functor a, Functor b) => Functor (Deep a b) Source # 

Methods

fmap :: (a -> b) -> Deep a b a -> Deep a b b #

(<$) :: a -> Deep a b b -> Deep a b a #

(Monad a, Applicative b) => Applicative (Deep a b) Source # 

Methods

pure :: a -> Deep a b a #

(<*>) :: Deep a b (a -> b) -> Deep a b a -> Deep a b b #

(*>) :: Deep a b a -> Deep a b b -> Deep a b b #

(<*) :: Deep a b a -> Deep a b b -> Deep a b a #

Eq (a (b c)) => Eq (Deep a b c) Source # 

Methods

(==) :: Deep a b c -> Deep a b c -> Bool #

(/=) :: Deep a b c -> Deep a b c -> Bool #

Show (a (b c)) => Show (Deep a b c) Source # 

Methods

showsPrec :: Int -> Deep a b c -> ShowS #

show :: Deep a b c -> String #

showList :: [Deep a b c] -> ShowS #

wrap :: Monad a => b c -> Deep a b c Source #

inject :: (Functor a, Monad b) => a c -> Deep a b c Source #

eject :: Functor a => (b c -> c) -> Deep a b c -> a c Source #

reduceABA :: (Applicative a, Monad a, Traversable b) => a (b (a x)) -> a (b x) Source #

Reduces A (B (A x)) to A (B x).

reduceBAB :: (Applicative a, Traversable b, Monad b) => b (a (b x)) -> a (b x) Source #

Reduces B (A (B x)) to A (B x).

reduceABAB :: (Applicative a, Monad a, Traversable b, Monad b) => a (b (a (b x))) -> a (b x) Source #

Reduces A (B (A (B x))) to A (B x).

reduceBABA :: (Applicative a, Monad a, Traversable b, Monad b) => b (a (b (a x))) -> a (b x) Source #

Reduces B (A (B (A x))) to A (B x).

(<$$>) :: (Functor a, Functor b) => (x -> y) -> a (b x) -> a (b y) infixl 4 Source #

"Deep" fmap for mapping over nested functors.

(>>>=) :: (Applicative a, Monad a, Traversable b, Monad b) => a (b x) -> (x -> a (b y)) -> a (b y) infixl 1 Source #

Variety of "deep bind" for chaining operations on nested data structures.

(>>==) :: (Functor a, Functor b, Monad b) => a (b x) -> (x -> b y) -> a (b y) infixl 1 Source #

Variety of "deep bind" for chaining operations on nested data structures.

(>=>=) :: (Applicative a, Monad a, Traversable b) => a (b x) -> (x -> a y) -> a (b y) infixl 1 Source #

Variety of "deep bind" for chaining operations on nested data structures.