-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Provide more deeper level style of programming than the usual Control.xxx modules express -- -- This module enables more deeper level style of programming than the -- usual Control.xxx modules express, especially for Applicative and -- Monad. @package deepcontrol @version 0.3.2.0 -- | This module enables you to program in applicative style for more -- deeper level than the usual Applicative module -- expresses. You would soon realize exactly what more deeper -- level means by reading the example codes in order, which are -- attached on the functions below. Note: all the braket-cover notation -- for Level-4 and Level-5 haven't been written yet. module DeepControl.Applicative -- | Alias for $. -- --
--   >>> (1+) |> 2
--   3
--   
(|>) :: (a -> b) -> a -> b -- | The auguments-flipped function for |>. -- --
--   >>> 1 <| (+2)
--   3 
--   
--   >>> 1 <|(+)|> 2
--   3 
--   
--   >>> 1 <|(+)|> 2 <|(*)|> 3
--   9
--   
-- --
--   >>> 1 <|(,)|> 2
--   (1,2)
--   
(<|) :: a -> (a -> b) -> b -- | Alias for pure. (*:) :: (Applicative f) => a -> f a -- | Alias for <$>. -- --
--   >>> (1+) |$> [2]
--   [3]
--   
(|$>) :: Functor f => (a -> b) -> f a -> f b -- | The auguments-flipped function for |$>. -- --
--   >>> [1] <$| (+2)
--   [3]
--   
-- --
--   >>> ("<"++)|$> ["a","b"] <$|(++">")
--   ["<a>","<b>"]
--   
(<$|) :: Functor f => f a -> (a -> b) -> f b -- | Alias for <*>. -- --
--   >>> [(1+)] |*> [2]
--   [3]
--   
-- --
--   >>> [1] <$|(+)|*> [2]
--   [3]
--   
--   >>> [1] <$|(+)|*> [0,1,2]
--   [1,2,3]
--   
--   >>> [0,1] <$|(+)|*> [2,3] <$|(^)|*> [4,5]
--   [16,32,81,243,81,243,256,1024]
--   
-- --
--   >>> foldr (\x acc -> x <$|(:)|*> acc) ((*:) []) [Just 1, Just 2,  Just 3]
--   Just [1,2,3]
--   
--   >>> foldr (\x acc -> x <$|(:)|*> acc) ((*:) []) [Just 1, Nothing, Just 3]
--   Nothing
--   
-- --
--   >>> filter (even <$|(&&)|*> (10 >)) [1..100]
--   [2,4,6,8]
--   
--   >>> filter (even <$|(&&)|*> (10 >) <$|(&&)|*> (5 <)) [1..100]
--   [6,8]
--   
(|*>) :: Applicative f => f (a -> b) -> f a -> f b -- | The auguments-flipped function for |*>. (<*|) :: Applicative f => f a -> f (a -> b) -> f b -- | Combination consisted of ket |*> and cover -- *:, defined as f |* x = f |*> (*:) x. -- --
--   >>> [(1+)] |* 2
--   [3]
--   
--   >>> [1] <$|(+)|* 2
--   [3]
--   
--   >>> [1] <$|(+)|* 2 <$|(*)|* 3
--   [9]
--   
-- --
--   >>> Just 1 <$|(,)|* 2
--   Just (1,2)
--   
(|*) :: Applicative f => f (a -> b) -> a -> f b -- | The auguments-flipped function for |*. -- --
--   >>> 1 *| [(+2)]
--   [3]
--   
--   >>> 1 *| [(+)] |* 2
--   [3]
--   
--   >>> 1 *|[(+),(-),(*),(^)]|* 2
--   [3,-1,2,1]
--   
-- --
--   >>> 1 *|Just (,)|* 2
--   Just (1,2)
--   
(*|) :: Applicative f => a -> f (a -> b) -> f b -- | Combination consisted of cover *: twice, defined as -- (**:) = (*:) . (*:). (**:) :: (Applicative f1, Applicative f2) => a -> f1 (f2 a) -- | Alias for *:. (*-) :: (Applicative f1, Applicative f2) => f2 a -> f1 (f2 a) -- | Combination consisted of cover *: and ket -- |$>, defined as (-*) = ((*:)|$>). (-*) :: (Applicative f1, Applicative f2) => f1 a -> f1 (f2 a) -- | Combination consisted of cover |$> twice, defined -- as (|$>>) = (|$>) . (|$>). -- --
--   >>> (+1) |$>> [[2]]
--   [[3]]
--   
(|$>>) :: (Functor f1, Functor f2) => (a -> b) -> f1 (f2 a) -> f1 (f2 b) -- | The auguments-flipped function for |$>> -- --
--   >>> [[2]] <<$| (+1)
--   [[3]]
--   
(<<$|) :: (Functor f1, Functor f2) => f1 (f2 a) -> (a -> b) -> f1 (f2 b) -- | The lifted function of |*>, defined as -- (|*>>) = liftA2 (|*>). -- --
--   >>> [Just 1] <<$|(+)|*>> [Just 2]
--   [Just 3]
--   
-- --
--   >>> [Just 1] <<$|(,)|*>> [Just 2]
--   [Just (1,2)]
--   
-- --
--   >>> [[1]] <<$|(+)|*>> [[2]] <<$|(-)|*>> [[3]]
--   [[0]]
--   
-- --
--   >>> foldr (\n acc -> n <<$|(+)|*>> acc) ((**:) 0) [Right (Just 1), Right (Just 2), Right (Just 3)] :: Either () (Maybe Int)
--   Right (Just 6)
--   
--   >>> foldr (\n acc -> n <<$|(+)|*>> acc) ((**:) 0) [Right (Just 1), Right Nothing, Right (Just 3)] :: Either () (Maybe Int)
--   Right Nothing
--   
--   >>> foldr (\n acc -> n <<$|(+)|*>> acc) ((**:) 0) [Right (Just 1), Right Nothing, Left ()]
--   Left ()
--   
(|*>>) :: (Applicative f1, Applicative f2) => f1 (f2 (a -> b)) -> f1 (f2 a) -> f1 (f2 b) -- | The lifted function of <*|, defined as -- (<<*|) = liftA2 (<*|). (<<*|) :: (Applicative f1, Applicative f2) => f1 (f2 a) -> f1 (f2 (a -> b)) -> f1 (f2 b) -- | Combination consisted of ket |*>> and cover -- **:, defined as f |** x = f |*>> (**:) -- x. -- --
--   >>> [Just 1] <<$|(+)|** 2
--   [Just 3]
--   
(|**) :: (Applicative f1, Applicative f2) => f1 (f2 (a -> b)) -> a -> f1 (f2 b) -- | The auguments-flipped function for |**. -- --
--   >>> 1 **|(+)|$>> [Just 2]
--   [Just 3]
--   
-- --
--   >>> 1 **|[Just (+)]|**  2
--   [Just 3]
--   
--   >>> 1 **|[Just (+), Just (-), Just (*), Nothing]|** 2
--   [Just 3,Just (-1),Just 2,Nothing]
--   
(**|) :: (Applicative f1, Applicative f2) => a -> f1 (f2 (a -> b)) -> f1 (f2 b) -- | Combination consisted of ket |*>> and cover -- -*, defined as f |-* x = f |*>> (-*) x. -- --
--   >>> [Just 1] <<$|(+)|-* [2]
--   [Just 3]
--   
(|-*) :: (Applicative f1, Applicative f2) => f1 (f2 (a -> b)) -> f1 a -> f1 (f2 b) -- | Combination consisted of ket |*>> and cover -- *-, defined as f |*- x = f |*>> (*-) x. -- --
--   >>> [Just 1] <<$|(+)|*- Just 2
--   [Just 3]
--   
(|*-) :: (Applicative f1, Applicative f2) => f1 (f2 (a -> b)) -> f2 a -> f1 (f2 b) -- | The auguments-flipped function for |-*. -- --
--   >>> [1] -*|(+)|$>> [Just 2]
--   [Just 3]
--   
(-*|) :: (Applicative f1, Applicative f2) => f1 a -> f1 (f2 (a -> b)) -> f1 (f2 b) -- | The auguments-flipped function for |*-. -- --
--   >>> Just 1 *-|(+)|$>> [Just 2]
--   [Just 3]
--   
--   >>> Just 1 *-|[Just (+)]|** 2
--   [Just 3]
--   
--   >>> Just 1 *-|[Just (+)]|*- Just 2
--   [Just 3]
--   
--   >>> [1] -*|[Just (+)]|*- Just 2
--   [Just 3]
--   
--   >>> [1] -*|[Just (+), Just (-), Just (*), Nothing]|*- Just 2
--   [Just 3,Just (-1),Just 2,Nothing]
--   
--   >>> [0,1] -*|[Just (+), Just (-), Just (*), Nothing]|*- Just 2
--   [Just 2,Just 3,Just (-2),Just (-1),Just 0,Just 2,Nothing,Nothing]
--   
-- --
--   >>> print 1 -*|return [\_ _ -> 3]|-* print 2
--   1
--   2
--   [3]
--   
(*-|) :: (Applicative f1, Applicative f2) => f2 a -> f1 (f2 (a -> b)) -> f1 (f2 b) -- | The lifted function of *>, defined as liftA2 -- (*>). -- --
--   >>> sequence $ Just (print 1) *>> (**:) 2
--   1
--   Just 2
--   
-- --
--   >>> (-*) (print 1) *>> return (Just 2)
--   1
--   Just 2
--   
(*>>) :: (Applicative f1, Applicative f2) => f1 (f2 a) -> f1 (f2 b) -> f1 (f2 b) -- | The lifted function of <*, defined as liftA2 -- (<*). -- --
--   >>> sequence $ (**:) 2 <<* Just (print 1)
--   1
--   Just 2
--   
--   >>> sequence $ Just (print 1) *>> (**:) 3 <<* Just (print 2)
--   1
--   2
--   Just 3
--   
-- --
--   >>> sequence $ [putStr "1", putStr "2"] *>> (**:) 0 <<* [putStr "3", putStr "4"]
--   13142324[0,0,0,0]
--   
(<<*) :: (Applicative f1, Applicative f2) => f1 (f2 a) -> f1 (f2 b) -> f1 (f2 a) -- | Combination consisted of sequence *>> and cover -- -*. -- --
--   >>> print 1 -*> (*:) (Just 2)
--   1
--   Just 2
--   
(-*>) :: (Applicative f1, Applicative f2) => f1 a -> f1 (f2 b) -> f1 (f2 b) -- | Combination consisted of sequence <<* and cover -- -*. -- --
--   >>> (*:) (Just 2) <-* print 1
--   1
--   Just 2
--   
--   >>> print 1 -*> (*:) (Just 3) <-* print 2
--   1
--   2
--   Just 3
--   
--   >>> print 1 -*> (*:) (Just 3) <*- Nothing
--   1
--   Nothing
--   
(<-*) :: (Applicative f1, Applicative f2) => f1 (f2 b) -> f1 a -> f1 (f2 b) -- | Combination consisted of sequence *>> and cover -- *:. -- --
--   >>> sequence $ print 1 *-> Just ((*:) 2)
--   1
--   Just 2
--   
(*->) :: (Applicative f1, Applicative f2) => f2 a -> f1 (f2 b) -> f1 (f2 b) -- | Combination consisted of sequence <<* and cover -- *:. -- --
--   >>> sequence $ Just ((*:) 2) <*- print 1
--   1
--   Just 2
--   
--   >>> sequence $ print 1 *-> Just ((*:) 3) <*- print 2
--   1
--   2
--   Just 3
--   
--   >>> sequence $ print 1 *-> Just ((*:) 3) <-* Nothing
--   Nothing
--   
(<*-) :: (Applicative f1, Applicative f2) => f1 (f2 b) -> f2 a -> f1 (f2 b) (***:) :: (Applicative f1, Applicative f2, Applicative f3) => a -> f1 (f2 (f3 a)) (**-) :: (Applicative f1, Applicative f2, Applicative f3) => f3 a -> f1 (f2 (f3 a)) (*-*) :: (Applicative f1, Applicative f2, Applicative f3) => f2 a -> f1 (f2 (f3 a)) (-**) :: (Applicative f1, Applicative f2, Applicative f3) => f1 a -> f1 (f2 (f3 a)) (--*) :: (Applicative f1, Applicative f2, Applicative f3) => f1 (f2 a) -> f1 (f2 (f3 a)) (-*-) :: (Applicative f1, Applicative f2, Applicative f3) => f1 (f3 a) -> f1 (f2 (f3 a)) (*--) :: (Applicative f1, Applicative f2, Applicative f3) => f2 (f3 a) -> f1 (f2 (f3 a)) (|$>>>) :: (Functor f1, Functor f2, Functor f3) => (a -> b) -> f1 (f2 (f3 a)) -> f1 (f2 (f3 b)) (<<<$|) :: (Functor f1, Functor f2, Functor f3) => f1 (f2 (f3 a)) -> (a -> b) -> f1 (f2 (f3 b)) (|*>>>) :: (Applicative f1, Applicative f2, Applicative f3) => f1 (f2 (f3 (a -> b))) -> f1 (f2 (f3 a)) -> f1 (f2 (f3 b)) (<<<*|) :: (Applicative f1, Applicative f2, Applicative f3) => f1 (f2 (f3 a)) -> f1 (f2 (f3 (a -> b))) -> f1 (f2 (f3 b)) (|***) :: (Applicative f1, Applicative f2, Applicative f3) => f1 (f2 (f3 (a -> b))) -> a -> f1 (f2 (f3 b)) (***|) :: (Applicative f1, Applicative f2, Applicative f3) => a -> f1 (f2 (f3 (a -> b))) -> f1 (f2 (f3 b)) (|-**) :: (Applicative f1, Applicative f2, Applicative f3) => f1 (f2 (f3 (a -> b))) -> f1 a -> f1 (f2 (f3 b)) (|*-*) :: (Applicative f1, Applicative f2, Applicative f3) => f1 (f2 (f3 (a -> b))) -> f2 a -> f1 (f2 (f3 b)) (|**-) :: (Applicative f1, Applicative f2, Applicative f3) => f1 (f2 (f3 (a -> b))) -> f3 a -> f1 (f2 (f3 b)) (|--*) :: (Applicative f1, Applicative f2, Applicative f3) => f1 (f2 (f3 (a -> b))) -> f1 (f2 a) -> f1 (f2 (f3 b)) (|-*-) :: (Applicative f1, Applicative f2, Applicative f3) => f1 (f2 (f3 (a -> b))) -> f1 (f3 a) -> f1 (f2 (f3 b)) (|*--) :: (Applicative f1, Applicative f2, Applicative f3) => f1 (f2 (f3 (a -> b))) -> f2 (f3 a) -> f1 (f2 (f3 b)) (-**|) :: (Applicative f1, Applicative f2, Applicative f3) => f1 a -> f1 (f2 (f3 (a -> b))) -> f1 (f2 (f3 b)) (*-*|) :: (Applicative f1, Applicative f2, Applicative f3) => f2 a -> f1 (f2 (f3 (a -> b))) -> f1 (f2 (f3 b)) (**-|) :: (Applicative f1, Applicative f2, Applicative f3) => f3 a -> f1 (f2 (f3 (a -> b))) -> f1 (f2 (f3 b)) (--*|) :: (Applicative f1, Applicative f2, Applicative f3) => f1 (f2 a) -> f1 (f2 (f3 (a -> b))) -> f1 (f2 (f3 b)) (-*-|) :: (Applicative f1, Applicative f2, Applicative f3) => f1 (f3 a) -> f1 (f2 (f3 (a -> b))) -> f1 (f2 (f3 b)) (*--|) :: (Applicative f1, Applicative f2, Applicative f3) => f2 (f3 a) -> f1 (f2 (f3 (a -> b))) -> f1 (f2 (f3 b)) (*>>>) :: (Applicative f1, Applicative f2, Applicative f3) => f1 (f2 (f3 a)) -> f1 (f2 (f3 b)) -> f1 (f2 (f3 b)) (<<<*) :: (Applicative f1, Applicative f2, Applicative f3) => f1 (f2 (f3 a)) -> f1 (f2 (f3 b)) -> f1 (f2 (f3 a)) (*-->) :: (Applicative f1, Applicative f2, Applicative f3) => f2 (f3 a) -> f1 (f2 (f3 b)) -> f1 (f2 (f3 b)) (-*->) :: (Applicative f1, Applicative f2, Applicative f3) => f1 (f3 a) -> f1 (f2 (f3 b)) -> f1 (f2 (f3 b)) (--*>) :: (Applicative f1, Applicative f2, Applicative f3) => f1 (f2 a) -> f1 (f2 (f3 b)) -> f1 (f2 (f3 b)) (**->) :: (Applicative f1, Applicative f2, Applicative f3) => f3 a -> f1 (f2 (f3 b)) -> f1 (f2 (f3 b)) (*-*>) :: (Applicative f1, Applicative f2, Applicative f3) => f2 a -> f1 (f2 (f3 b)) -> f1 (f2 (f3 b)) (-**>) :: (Applicative f1, Applicative f2, Applicative f3) => f1 a -> f1 (f2 (f3 b)) -> f1 (f2 (f3 b)) (<*--) :: (Applicative f1, Applicative f2, Applicative f3) => f1 (f2 (f3 b)) -> f2 (f3 a) -> f1 (f2 (f3 b)) (<-*-) :: (Applicative f1, Applicative f2, Applicative f3) => f1 (f2 (f3 b)) -> f1 (f3 a) -> f1 (f2 (f3 b)) (<--*) :: (Applicative f1, Applicative f2, Applicative f3) => f1 (f2 (f3 b)) -> f1 (f2 a) -> f1 (f2 (f3 b)) (<**-) :: (Applicative f1, Applicative f2, Applicative f3) => f1 (f2 (f3 b)) -> f3 a -> f1 (f2 (f3 b)) (<*-*) :: (Applicative f1, Applicative f2, Applicative f3) => f1 (f2 (f3 b)) -> f2 a -> f1 (f2 (f3 b)) (<-**) :: (Applicative f1, Applicative f2, Applicative f3) => f1 (f2 (f3 b)) -> f1 a -> f1 (f2 (f3 b)) (****:) :: (Applicative f1, Applicative f2, Applicative f3, Applicative f4) => a -> f1 (f2 (f3 (f4 a))) (|$>>>>) :: (Functor f1, Functor f2, Functor f3, Functor f4) => (a -> b) -> f1 (f2 (f3 (f4 a))) -> f1 (f2 (f3 (f4 b))) (<<<<$|) :: (Functor f1, Functor f2, Functor f3, Functor f4) => f1 (f2 (f3 (f4 a))) -> (a -> b) -> f1 (f2 (f3 (f4 b))) (|*>>>>) :: (Applicative f1, Applicative f2, Applicative f3, Applicative f4) => f1 (f2 (f3 (f4 (a -> b)))) -> f1 (f2 (f3 (f4 a))) -> f1 (f2 (f3 (f4 b))) (<<<<*|) :: (Applicative f1, Applicative f2, Applicative f3, Applicative f4) => f1 (f2 (f3 (f4 a))) -> f1 (f2 (f3 (f4 (a -> b)))) -> f1 (f2 (f3 (f4 b))) (*>>>>) :: (Applicative f1, Applicative f2, Applicative f3, Applicative f4) => f1 (f2 (f3 (f4 a))) -> f1 (f2 (f3 (f4 b))) -> f1 (f2 (f3 (f4 b))) (<<<<*) :: (Applicative f1, Applicative f2, Applicative f3, Applicative f4) => f1 (f2 (f3 (f4 a))) -> f1 (f2 (f3 (f4 b))) -> f1 (f2 (f3 (f4 a))) (*****:) :: (Applicative f1, Applicative f2, Applicative f3, Applicative f4, Applicative f5) => a -> f1 (f2 (f3 (f4 (f5 a)))) (|$>>>>>) :: (Functor f1, Functor f2, Functor f3, Functor f4, Functor f5) => (a -> b) -> f1 (f2 (f3 (f4 (f5 a)))) -> f1 (f2 (f3 (f4 (f5 b)))) (<<<<<$|) :: (Functor f1, Functor f2, Functor f3, Functor f4, Functor f5) => f1 (f2 (f3 (f4 (f5 a)))) -> (a -> b) -> f1 (f2 (f3 (f4 (f5 b)))) (|*>>>>>) :: (Applicative f1, Applicative f2, Applicative f3, Applicative f4, Applicative f5) => f1 (f2 (f3 (f4 (f5 (a -> b))))) -> f1 (f2 (f3 (f4 (f5 a)))) -> f1 (f2 (f3 (f4 (f5 b)))) (<<<<<*|) :: (Applicative f1, Applicative f2, Applicative f3, Applicative f4, Applicative f5) => f1 (f2 (f3 (f4 (f5 a)))) -> f1 (f2 (f3 (f4 (f5 (a -> b))))) -> f1 (f2 (f3 (f4 (f5 b)))) (*>>>>>) :: (Applicative f1, Applicative f2, Applicative f3, Applicative f4, Applicative f5) => f1 (f2 (f3 (f4 (f5 a)))) -> f1 (f2 (f3 (f4 (f5 b)))) -> f1 (f2 (f3 (f4 (f5 b)))) (<<<<<*) :: (Applicative f1, Applicative f2, Applicative f3, Applicative f4, Applicative f5) => f1 (f2 (f3 (f4 (f5 a)))) -> f1 (f2 (f3 (f4 (f5 b)))) -> f1 (f2 (f3 (f4 (f5 a)))) -- | This module enables you to program in Monad for more deeper -- level than the usual Monad module expresses. You would soon -- realize exactly what more deeper level means by reading -- the example codes in order, which are attached on the Monadx(Monad2, -- Monad3, etc) classes below. -- -- Note: -- -- module DeepControl.Monad -- | Alias for $. -- --
--   >>> Just -< 3
--   Just 3
--   
(-<) :: (a -> b) -> a -> b -- | The auguments-flipped function for -<. -- --
--   >>> 3 >- Just
--   Just 3
--   
-- --
--   >>> :{
--   let plus :: Int -> Int -> Int
--       plus x y = 
--           x >- \a ->
--           y >- \b ->
--           a + b
--   in plus 3 4
--   :}
--   7
--   
(>-) :: a -> (a -> b) -> b -- | The auguments-flipped function for <-<. -- --
--   >>> 1 >- ((+1) >-> (*2) >-> (+3))
--   7
--   
(>->) :: (a -> b) -> (b -> c) -> a -> c -- | Alias for .. -- --
--   >>> ((3+) <-< (2*) <-< (1+)) -< 1
--   7
--   
(<-<) :: (b -> c) -> (a -> b) -> a -> c -- | The auguments-flipped function for >>. (<<) :: Monad m => m b -> m a -> m b -- | The Monad2 class defines the Monad functions for level-2 types -- m1 (m2 a); such as [[a]], Maybe [a], Either () (Maybe a), a -- -> [b], IO [a], etc. -- --
--   >>> :{
--    -- List-List Monad
--    [["a","b"]] >>== \x -> 
--    [[0],[1,2]] >>== \y -> 
--    (**:) (x ++ show y)
--   :}
--   [["a0","b0"],["a0","b1","b2"],["a1","a2","b0"],["a1","a2","b1","b2"]]
--   
-- --
--   >>> :{
--    let lengthM :: [Int] -> Maybe Int   -- ((->) [Int])-Maybe Monad
--        lengthM [] = Nothing
--        lengthM xs = Just (length xs) 
--        averageM :: [Int] -> Maybe Double
--        averageM = 
--            sum >-== \s ->      -- sum :: [Int] -> Int -- ((->) [Int]) Monad
--            lengthM >>== \l ->
--            (**:) (fromIntegral s / fromIntegral l)
--    in [averageM [10, 25, 70], averageM []]
--   :}
--   [Just 35.0,Nothing]
--   
class (Monad m2) => Monad2 m2 -- | Bind function of level-2. (>>==) :: (Monad2 m2, Monad m1) => m1 (m2 a) -> (a -> m1 (m2 b)) -> m1 (m2 b) -- | Sequence function of level-2. (>>~) :: (Monad m1, Monad2 m2) => m1 (m2 a) -> m1 (m2 b) -> m1 (m2 b) -- | Bind-cover function made of bind >>== and cover -- -*, defined as m >-== k = (-*) m >>== -- k. (>-==) :: (Monad m1, Monad2 m2) => m1 a -> (a -> m1 (m2 b)) -> m1 (m2 b) -- | Bind-cover function made of bind >>== and cover -- *-, defined as m >-== k = (*-) m >>== -- k. (->==) :: (Monad m1, Monad2 m2) => m2 a -> (a -> m1 (m2 b)) -> m1 (m2 b) -- | Sequence-cover function made of sequence >>~ and -- cover -*, defined as m >-~ k = (-*) m >>~ -- k. (>-~) :: (Monad m1, Monad2 m2) => m1 a -> m1 (m2 b) -> m1 (m2 b) -- | Sequence-cover function made of sequence >>~ and -- cover *-, defined as m >-~ k = (*-) m >>~ -- k. (->~) :: (Monad m1, Monad2 m2) => m2 a -> m1 (m2 b) -> m1 (m2 b) -- | Composite function of level-2. (>==>) :: (Monad m1, Monad2 m2) => (a -> m1 (m2 b)) -> (b -> m1 (m2 c)) -> a -> m1 (m2 c) -- | The Monad3 class defines the Monad functions for level-3 types -- m1 (m2 (m3 a). -- --
--   >>> :{
--    -- IO-List-List Monad
--    [["a","b"]] ->>== \x ->
--    [[0],[1,2]] ->>== \y ->
--    print (x,y) >--~
--    (***:) (x ++ show y)
--   :}
--   ("a",0)
--   ("a",1)
--   ("a",2)
--   ("b",0)
--   ("b",1)
--   ("b",2)
--   [["a0","b0"],["a0","b1","b2"],["a1","a2","b0"],["a1","a2","b1","b2"]]
--   
class (Monad2 m3) => Monad3 m3 (>>>==) :: (Monad3 m3, Monad m1, Monad2 m2) => m1 (m2 (m3 a)) -> (a -> m1 (m2 (m3 b))) -> m1 (m2 (m3 b)) (>>-==) :: (Monad m1, Monad2 m2, Monad3 m3) => m1 (m2 a) -> (a -> m1 (m2 (m3 b))) -> m1 (m2 (m3 b)) (->>==) :: (Monad m1, Monad2 m2, Monad3 m3) => m2 (m3 a) -> (a -> m1 (m2 (m3 b))) -> m1 (m2 (m3 b)) (>->==) :: (Monad m1, Monad2 m2, Monad3 m3) => m1 (m3 a) -> (a -> m1 (m2 (m3 b))) -> m1 (m2 (m3 b)) (>--==) :: (Monad m1, Monad2 m2, Monad3 m3) => m1 a -> (a -> m1 (m2 (m3 b))) -> m1 (m2 (m3 b)) (->-==) :: (Monad m1, Monad2 m2, Monad3 m3) => m2 a -> (a -> m1 (m2 (m3 b))) -> m1 (m2 (m3 b)) (-->==) :: (Monad m1, Monad2 m2, Monad3 m3) => m3 a -> (a -> m1 (m2 (m3 b))) -> m1 (m2 (m3 b)) (>>>~) :: (Monad m1, Monad2 m2, Monad3 m3) => m1 (m2 (m3 a)) -> m1 (m2 (m3 b)) -> m1 (m2 (m3 b)) (->-~) :: (Monad m1, Monad2 m2, Monad3 m3) => m2 a -> m1 (m2 (m3 b)) -> m1 (m2 (m3 b)) (-->~) :: (Monad m1, Monad2 m2, Monad3 m3) => m3 a -> m1 (m2 (m3 b)) -> m1 (m2 (m3 b)) (>>-~) :: (Monad m1, Monad2 m2, Monad3 m3) => m1 (m2 a) -> m1 (m2 (m3 b)) -> m1 (m2 (m3 b)) (->>~) :: (Monad m1, Monad2 m2, Monad3 m3) => m2 (m3 a) -> m1 (m2 (m3 b)) -> m1 (m2 (m3 b)) (>->~) :: (Monad m1, Monad2 m2, Monad3 m3) => m1 (m3 a) -> m1 (m2 (m3 b)) -> m1 (m2 (m3 b)) (>--~) :: (Monad m1, Monad2 m2, Monad3 m3) => m1 a -> m1 (m2 (m3 b)) -> m1 (m2 (m3 b)) (>===>) :: (Monad m1, Monad2 m2, Monad3 m3) => (a -> m1 (m2 (m3 b))) -> (b -> m1 (m2 (m3 c))) -> a -> m1 (m2 (m3 c)) class (Monad3 m4) => Monad4 m4 (>>>>==) :: (Monad4 m4, Monad m1, Monad2 m2, Monad3 m3) => m1 (m2 (m3 (m4 a))) -> (a -> m1 (m2 (m3 (m4 b)))) -> m1 (m2 (m3 (m4 b))) (>>>>~) :: (Monad m1, Monad2 m2, Monad3 m3, Monad4 m4) => m1 (m2 (m3 (m4 a))) -> m1 (m2 (m3 (m4 b))) -> m1 (m2 (m3 (m4 b))) (>====>) :: (Monad m1, Monad2 m2, Monad3 m3, Monad4 m4) => (a -> m1 (m2 (m3 (m4 b)))) -> (b -> m1 (m2 (m3 (m4 c)))) -> a -> m1 (m2 (m3 (m4 c))) class (Monad4 m5) => Monad5 m5 (>>>>>==) :: (Monad5 m5, Monad m1, Monad2 m2, Monad3 m3, Monad4 m4) => m1 (m2 (m3 (m4 (m5 a)))) -> (a -> m1 (m2 (m3 (m4 (m5 b))))) -> m1 (m2 (m3 (m4 (m5 b)))) (>>>>>~) :: (Monad m1, Monad2 m2, Monad3 m3, Monad4 m4, Monad5 m5) => m1 (m2 (m3 (m4 (m5 a)))) -> m1 (m2 (m3 (m4 (m5 b)))) -> m1 (m2 (m3 (m4 (m5 b)))) (>=====>) :: (Monad m1, Monad2 m2, Monad3 m3, Monad4 m4, Monad5 m5) => (a -> m1 (m2 (m3 (m4 (m5 b))))) -> (b -> m1 (m2 (m3 (m4 (m5 c))))) -> a -> m1 (m2 (m3 (m4 (m5 c)))) instance DeepControl.Monad.Monad2 GHC.Base.Maybe instance DeepControl.Monad.Monad2 [] instance DeepControl.Monad.Monad2 (Data.Either.Either e) instance DeepControl.Monad.Monad3 GHC.Base.Maybe instance DeepControl.Monad.Monad3 [] instance DeepControl.Monad.Monad3 (Data.Either.Either e) instance DeepControl.Monad.Monad4 GHC.Base.Maybe instance DeepControl.Monad.Monad4 [] instance DeepControl.Monad.Monad4 (Data.Either.Either e) instance DeepControl.Monad.Monad5 GHC.Base.Maybe instance DeepControl.Monad.Monad5 [] instance DeepControl.Monad.Monad5 (Data.Either.Either e) -- | This module is made of Traversable, distilling most -- function names polluted with action kind of concepts into -- crystalized(static) ones. Another reason I put this module is for the -- case if GHC would parse ((->) r) as a data constructor -- someday. module DeepControl.Commutative class (Functor c) => Commutative c -- | This method is equivalent for sequenceA just except -- the name. The only difference is the name "commute", that is to say -- from which no action kind of concepts smell. commute :: (Commutative c, Applicative f) => c (f a) -> f (c a) -- | Do fmap f then commute, equivalent for -- traverse. cmap :: (Applicative f, Commutative c) => (a -> f b) -> c a -> f (c b) -- | The auguments-flipped function for cmap, equivalent -- for for. cfor :: (Applicative f, Commutative c) => c a -> (a -> f b) -> f (c b) -- | This function may be used as a value for fmap in a -- Functor instance, provided that commute is defined. -- (Using fmapDefault with a Commutative instance will -- result in infinite recursion.) fmapDefault :: Commutative t => (a -> b) -> t a -> t b -- | This function may be used as a value for foldMap in a -- Foldable instance. foldMapDefault :: (Commutative t, Monoid m) => (a -> m) -> t a -> m instance DeepControl.Commutative.Commutative GHC.Base.Maybe instance DeepControl.Commutative.Commutative [] instance DeepControl.Commutative.Commutative (Data.Either.Either a) instance DeepControl.Commutative.Commutative ((,) a) instance DeepControl.Commutative.Commutative (Control.Applicative.Const m) instance GHC.Base.Functor DeepControl.Commutative.Id instance GHC.Base.Applicative DeepControl.Commutative.Id -- | This module enables you to program in Monad-Morphic style for more -- deeper level than the usual Control.Monad.Morph module -- expresses. You would realize exactly what more deeper -- level means by reading the example codes, which are attached -- on the page bottom. Note: many instances for Level-4 and Level-5 -- haven't been written yet. module DeepControl.Monad.Morph -- | Alias for hoist. (|>|) :: (Monad m, MFunctor t) => (forall a. m a -> n a) -> t m b -> t n b -- | Equivalent to (|>|) with the arguments flipped. (|<|) :: (Monad m, MFunctor t) => t m b -> (forall a. m a -> n a) -> t n b (|>>|) :: (Monad m, Monad (t2 m), MFunctor t1, MFunctor t2) => (forall a. m a -> n a) -> t1 (t2 m) b -> t1 (t2 n) b (|<<|) :: (Monad m, Monad (t2 m), MFunctor t1, MFunctor t2) => t1 (t2 m) b -> (forall a. m a -> n a) -> t1 (t2 n) b (|>>>|) :: (Monad m, Monad (t3 m), Monad (t2 (t3 m)), MFunctor t1, MFunctor t2, MFunctor t3) => (forall a. m a -> n a) -> t1 (t2 (t3 m)) b -> t1 (t2 (t3 n)) b (|<<<|) :: (Monad m, Monad (t3 m), Monad (t2 (t3 m)), MFunctor t1, MFunctor t2, MFunctor t3) => t1 (t2 (t3 m)) b -> (forall a. m a -> n a) -> t1 (t2 (t3 n)) b (|>>>>|) :: (Monad m, Monad (t4 m), Monad (t3 (t4 m)), Monad (t2 (t3 (t4 m))), MFunctor t1, MFunctor t2, MFunctor t3, MFunctor t4) => (forall a. m a -> n a) -> t1 (t2 (t3 (t4 m))) b -> t1 (t2 (t3 (t4 n))) b (|<<<<|) :: (Monad m, Monad (t4 m), Monad (t3 (t4 m)), Monad (t2 (t3 (t4 m))), MFunctor t1, MFunctor t2, MFunctor t3, MFunctor t4) => t1 (t2 (t3 (t4 m))) b -> (forall a. m a -> n a) -> t1 (t2 (t3 (t4 n))) b (|>>>>>|) :: (Monad m, Monad (t5 m), Monad (t4 (t5 m)), Monad (t3 (t4 (t5 m))), Monad (t2 (t3 (t4 (t5 m)))), MFunctor t1, MFunctor t2, MFunctor t3, MFunctor t4, MFunctor t5) => (forall a. m a -> n a) -> t1 (t2 (t3 (t4 (t5 m)))) b -> t1 (t2 (t3 (t4 (t5 n)))) b (|<<<<<|) :: (Monad m, Monad (t5 m), Monad (t4 (t5 m)), Monad (t3 (t4 (t5 m))), Monad (t2 (t3 (t4 (t5 m)))), MFunctor t1, MFunctor t2, MFunctor t3, MFunctor t4, MFunctor t5) => t1 (t2 (t3 (t4 (t5 m)))) b -> (forall a. m a -> n a) -> t1 (t2 (t3 (t4 (t5 n)))) b -- | This module enables you to program in Monad-Transformer style for more -- deeper level than the usual Control.Monad.Trans module -- expresses. You would realize exactly what more deeper -- level means by reading the example codes, which are attached -- on the page bottom. Note: many instances for Level-4 and Level-5 -- haven't been written yet. module DeepControl.Monad.Trans -- | Monads in which IO computations may be embedded. Any monad -- built by applying a sequence of monad transformers to the IO -- monad will be an instance of this class. -- -- Instances should satisfy the following laws, which state that -- liftIO is a transformer of monads: -- -- class Monad m => MonadIO (m :: * -> *) -- | Lift a computation from the IO monad. liftIO :: MonadIO m => IO a -> m a -- | The class of monad transformers. Instances should satisfy the -- following laws, which state that lift is a monad -- transformation: -- -- class MonadTrans (t :: (* -> *) -> * -> *) -- | Lift a computation from the argument monad to the constructed monad. lift :: (MonadTrans t, Monad m) => m a -> t m a class (Monad (TransDown t1), MonadTrans t1) => MonadTransDown t1 where type family TransDown t1 :: * -> * type M t1 = TransDown t1 class (MonadTransDown t1) => MonadTransCover t1 (|*|) :: (MonadTransCover t1, Monad m1) => (TransDown t1) a -> t1 m1 a -- | Required only for MonadTransFold2 and -- MonadTransFold3 class MonadTrans_ t1 trans :: (MonadTrans_ t1, Monad m2) => m2 ((TransDown t1) a) -> t1 m2 a untrans :: (MonadTrans_ t1, Monad m2) => t1 m2 a -> m2 ((TransDown t1) a) class MonadTrans2 t lift2 :: (MonadTrans2 t, Monad m1, Monad2 m2) => m1 (m2 a) -> t m1 m2 a class (MonadTrans (Trans2Down t2), MonadTrans2 t2) => MonadTrans2Down t2 where type family Trans2Down t2 :: (* -> *) -> * -> * type M_ t2 = TransDown (Trans2Down t2) type T_ t2 = Trans2Down t2 -- | Following property holds. -- --
--   untransfold2 . transfold2 == id
--   
class (MonadTrans (T_ t), MonadTrans2 t) => MonadTransFold2 t transfold2 :: (MonadTransFold2 t, Monad m1, Monad (t2 m1), MonadTrans_ t2) => t m1 (TransDown t2) a -> (T_ t) (t2 m1) a untransfold2 :: (MonadTransFold2 t, Monad m1, Monad (t2 m1), MonadTrans_ t2) => (T_ t) (t2 m1) a -> t m1 (TransDown t2) a class (MonadTransCover (Trans2Down t2)) => MonadTransCover2 t2 (|-*|) :: (MonadTransCover2 t2, Monad m1, Monad2 m2) => (Trans2Down t2) m1 a -> t2 m1 m2 a (|*-|) :: (MonadTransCover2 t2, Monad m1, Monad2 m2) => (Trans2Down t2) m2 a -> t2 m1 m2 a (|**|) :: (Monad m1, Monad2 m2, MonadTransCover2 t2) => (M_ t2) a -> t2 m1 m2 a trans2 :: (Monad m1, Monad (t2 m1), MonadTrans_ t2, MonadTrans_ t3) => m1 ((TransDown t2) ((TransDown t3) a)) -> t3 (t2 m1) a untrans2 :: (Monad m1, Monad (t2 m1), MonadTrans_ t2, MonadTrans_ t3) => t3 (t2 m1) a -> m1 ((TransDown t2) ((TransDown t3) a)) class MonadTrans3 t lift3 :: (MonadTrans3 t, Monad m1, Monad2 m2, Monad3 m3) => m1 (m2 (m3 a)) -> t m1 m2 m3 a class (MonadTrans2 (Trans3Down t3), MonadTrans3 t3) => MonadTrans3Down t3 where type family Trans3Down t3 :: (* -> *) -> (* -> *) -> * -> * type M__ t3 = M_ (Trans3Down t3) type T__ t3 = T_ (Trans3Down t3) -- | Following property holds. -- --
--   untransfold3 . transfold3 == id
--   
class (MonadTrans (T__ t), MonadTrans3 t) => MonadTransFold3 t transfold3 :: (MonadTransFold3 t, Monad m1, Monad (t2 m1), Monad (t3 (t2 m1)), MonadTrans t3, MonadTrans t2, MonadTrans_ t2, MonadTrans_ t3) => t m1 (TransDown t2) (TransDown t3) a -> (T__ t) (t3 (t2 m1)) a untransfold3 :: (MonadTransFold3 t, Monad m1, Monad (t2 m1), Monad (t3 (t2 m1)), MonadTrans t3, MonadTrans t2, MonadTrans_ t2, MonadTrans_ t3) => (T__ t) (t3 (t2 m1)) a -> t m1 (TransDown t2) (TransDown t3) a class (MonadTransCover2 (Trans3Down t3)) => MonadTransCover3 t3 (|--*|) :: (MonadTransCover3 t3, Monad m1, Monad2 m2, Monad3 m3) => (Trans3Down t3) m1 m2 a -> t3 m1 m2 m3 a (|-*-|) :: (MonadTransCover3 t3, Monad m1, Monad2 m2, Monad3 m3) => (Trans3Down t3) m1 m3 a -> t3 m1 m2 m3 a (|*--|) :: (MonadTransCover3 t3, Monad m1, Monad2 m2, Monad3 m3) => (Trans3Down t3) m2 m3 a -> t3 m1 m2 m3 a (|***|) :: (Monad m1, Monad2 m2, Monad3 m3, MonadTransCover3 t3) => (M__ t3) a -> t3 m1 m2 m3 a (|-**|) :: (Monad m1, Monad2 m2, Monad3 m3, MonadTransCover3 t3) => (T__ t3) m1 a -> t3 m1 m2 m3 a (|*-*|) :: (Monad m1, Monad2 m2, Monad3 m3, MonadTransCover3 t3) => (T__ t3) m2 a -> t3 m1 m2 m3 a (|**-|) :: (Monad m1, Monad2 m2, Monad3 m3, MonadTransCover3 t3) => (T__ t3) m3 a -> t3 m1 m2 m3 a trans3 :: (Monad m1, Monad (t3 (t2 m1)), Monad (t2 m1), MonadTrans_ t2, MonadTrans_ t3, MonadTrans_ t4) => m1 ((TransDown t2) ((TransDown t3) ((TransDown t4) a))) -> t4 (t3 (t2 m1)) a untrans3 :: (Monad m1, Monad (t3 (t2 m1)), Monad (t2 m1), MonadTrans_ t2, MonadTrans_ t3, MonadTrans_ t4) => t4 (t3 (t2 m1)) a -> m1 ((TransDown t2) ((TransDown t3) ((TransDown t4) a))) class MonadTrans4 t lift4 :: (MonadTrans4 t, Monad m1, Monad2 m2, Monad3 m3, Monad4 m4) => m1 (m2 (m3 (m4 a))) -> t m1 m2 m3 m4 a class MonadTrans5 t lift5 :: (MonadTrans5 t, Monad m1, Monad2 m2, Monad3 m3, Monad4 m4, Monad5 m5) => m1 (m2 (m3 (m4 (m5 a)))) -> t m1 m2 m3 m4 m5 a instance DeepControl.Monad.Trans.MonadTransDown Control.Monad.Trans.List.ListT instance DeepControl.Monad.Trans.MonadTransDown Control.Monad.Trans.Maybe.MaybeT instance DeepControl.Monad.Trans.MonadTransDown (Control.Monad.Trans.Except.ExceptT e) instance DeepControl.Monad.Trans.MonadTransCover Control.Monad.Trans.List.ListT instance DeepControl.Monad.Trans.MonadTransCover Control.Monad.Trans.Maybe.MaybeT instance DeepControl.Monad.Trans.MonadTransCover (Control.Monad.Trans.Except.ExceptT e) instance DeepControl.Monad.Trans.MonadTrans_ Control.Monad.Trans.List.ListT instance DeepControl.Monad.Trans.MonadTrans_ Control.Monad.Trans.Maybe.MaybeT instance DeepControl.Monad.Trans.MonadTrans_ (Control.Monad.Trans.Except.ExceptT e) -- | This module extended RWS Monad in mtl(monad-transformer-library). module DeepControl.Monad.Trans.Except instance DeepControl.Monad.Monad2 (Control.Monad.Trans.Except.Except e) instance DeepControl.Monad.Monad3 (Control.Monad.Trans.Except.Except e) instance DeepControl.Monad.Monad4 (Control.Monad.Trans.Except.Except e) instance DeepControl.Monad.Monad5 (Control.Monad.Trans.Except.Except e) instance DeepControl.Commutative.Commutative (Control.Monad.Trans.Except.Except e) -- | This module extended RWS Monad in mtl(monad-transformer-library). module DeepControl.Monad.Trans.RWS -- | See examples in Control.Monad.Reader. Note, the partially -- applied function type (->) r is a simple reader monad. See -- the instance declaration below. class Monad m => MonadReader r (m :: * -> *) | m -> r -- | Retrieves the monad environment. ask :: MonadReader r m => m r -- | Executes a computation in a modified environment. local :: MonadReader r m => (r -> r) -> m a -> m a -- | Retrieves a function of the current environment. reader :: MonadReader r m => (r -> a) -> m a class (Monoid w, Monad m) => MonadWriter w (m :: * -> *) | m -> w -- | writer (a,w) embeds a simple writer action. writer :: MonadWriter w m => (a, w) -> m a -- | tell w is an action that produces the output -- w. tell :: MonadWriter w m => w -> m () -- | listen m is an action that executes the action -- m and adds its output to the value of the computation. listen :: MonadWriter w m => m a -> m (a, w) -- | pass m is an action that executes the action -- m, which returns a value and a function, and returns the -- value, applying the function to the output. pass :: MonadWriter w m => m (a, w -> w) -> m a -- | Minimal definition is either both of get and put or -- just state class Monad m => MonadState s (m :: * -> *) | m -> s -- | Return the state from the internals of the monad. get :: MonadState s m => m s -- | Replace the state inside the monad. put :: MonadState s m => s -> m () -- | Embed a simple state action into the monad. state :: MonadState s m => (s -> (a, s)) -> m a newtype RWST2 r w s m1 m2 a RWST2 :: (r -> s -> m1 (m2 (a, s, w))) -> RWST2 r w s m1 m2 a [runRWST2] :: RWST2 r w s m1 m2 a -> r -> s -> m1 (m2 (a, s, w)) rwsT2 :: (Monad m1, Monad2 m2) => (r -> s -> (a, s, w)) -> RWST2 r w s m1 m2 a evalRWST2 :: (Monad m1, Monad2 m2) => RWST2 r w s m1 m2 a -> r -> s -> m1 (m2 (a, w)) execRWST2 :: (Monad m1, Monad2 m2) => RWST2 r w s m1 m2 a -> r -> s -> m1 (m2 (s, w)) mapRWST2 :: (m1 (m2 (a, s, w)) -> n1 (n2 (b, s, w'))) -> RWST2 r w s m1 m2 a -> RWST2 r w' s n1 n2 b withRWST2 :: (r' -> s -> (r, s)) -> RWST2 r w s m1 m2 a -> RWST2 r' w s m1 m2 a newtype RWST3 r w s m1 m2 m3 a RWST3 :: (r -> s -> m1 (m2 (m3 (a, s, w)))) -> RWST3 r w s m1 m2 m3 a [runRWST3] :: RWST3 r w s m1 m2 m3 a -> r -> s -> m1 (m2 (m3 (a, s, w))) rwsT3 :: (Monad m1, Monad2 m2, Monad3 m3) => (r -> s -> (a, s, w)) -> RWST3 r w s m1 m2 m3 a evalRWST3 :: (Monad m1, Monad2 m2, Monad3 m3) => RWST3 r w s m1 m2 m3 a -> r -> s -> m1 (m2 (m3 (a, w))) execRWST3 :: (Monad m1, Monad2 m2, Monad3 m3) => RWST3 r w s m1 m2 m3 a -> r -> s -> m1 (m2 (m3 (s, w))) mapRWST3 :: (m1 (m2 (m3 (a, s, w))) -> n1 (n2 (n3 (b, s, w')))) -> RWST3 r w s m1 m2 m3 a -> RWST3 r w' s n1 n2 n3 b withRWST3 :: (r' -> s -> (r, s)) -> RWST3 r w s m1 m2 m3 a -> RWST3 r' w s m1 m2 m3 a instance GHC.Base.Monoid w => DeepControl.Monad.Trans.MonadTransDown (Control.Monad.Trans.RWS.Lazy.RWST r w s) instance GHC.Base.Monoid w => DeepControl.Monad.Trans.MonadTransCover (Control.Monad.Trans.RWS.Lazy.RWST r w s) instance (GHC.Base.Functor m1, GHC.Base.Functor m2) => GHC.Base.Functor (DeepControl.Monad.Trans.RWS.RWST2 r w s m1 m2) instance (GHC.Base.Monoid w, GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2) => GHC.Base.Applicative (DeepControl.Monad.Trans.RWS.RWST2 r w s m1 m2) instance (GHC.Base.Monoid w, GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2) => GHC.Base.Monad (DeepControl.Monad.Trans.RWS.RWST2 r w s m1 m2) instance (GHC.Base.Monoid w, GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2) => Control.Monad.Reader.Class.MonadReader r (DeepControl.Monad.Trans.RWS.RWST2 r w s m1 m2) instance (GHC.Base.Monoid w, GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2) => Control.Monad.Writer.Class.MonadWriter w (DeepControl.Monad.Trans.RWS.RWST2 r w s m1 m2) instance (GHC.Base.Monoid w, GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2) => Control.Monad.State.Class.MonadState s (DeepControl.Monad.Trans.RWS.RWST2 r w s m1 m2) instance GHC.Base.Monoid w => DeepControl.Monad.Trans.MonadTrans2 (DeepControl.Monad.Trans.RWS.RWST2 r w s) instance (GHC.Base.Monoid w, Control.Monad.IO.Class.MonadIO m1, GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2) => Control.Monad.IO.Class.MonadIO (DeepControl.Monad.Trans.RWS.RWST2 r w s m1 m2) instance GHC.Base.Monoid w => DeepControl.Monad.Trans.MonadTrans2Down (DeepControl.Monad.Trans.RWS.RWST2 r w s) instance GHC.Base.Monoid w => DeepControl.Monad.Trans.MonadTransFold2 (DeepControl.Monad.Trans.RWS.RWST2 r w s) instance GHC.Base.Monoid w => DeepControl.Monad.Trans.MonadTransCover2 (DeepControl.Monad.Trans.RWS.RWST2 r w s) instance (GHC.Base.Functor m1, GHC.Base.Functor m2, GHC.Base.Functor m3) => GHC.Base.Functor (DeepControl.Monad.Trans.RWS.RWST3 r w s m1 m2 m3) instance (GHC.Base.Monoid w, GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2, DeepControl.Monad.Monad3 m3) => GHC.Base.Applicative (DeepControl.Monad.Trans.RWS.RWST3 r w s m1 m2 m3) instance (GHC.Base.Monoid w, GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2, DeepControl.Monad.Monad3 m3) => GHC.Base.Monad (DeepControl.Monad.Trans.RWS.RWST3 r w s m1 m2 m3) instance (GHC.Base.Monoid w, GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2, DeepControl.Monad.Monad3 m3) => Control.Monad.Reader.Class.MonadReader r (DeepControl.Monad.Trans.RWS.RWST3 r w s m1 m2 m3) instance (GHC.Base.Monoid w, GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2, DeepControl.Monad.Monad3 m3) => Control.Monad.Writer.Class.MonadWriter w (DeepControl.Monad.Trans.RWS.RWST3 r w s m1 m2 m3) instance (GHC.Base.Monoid w, GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2, DeepControl.Monad.Monad3 m3) => Control.Monad.State.Class.MonadState s (DeepControl.Monad.Trans.RWS.RWST3 r w s m1 m2 m3) instance GHC.Base.Monoid w => DeepControl.Monad.Trans.MonadTrans3 (DeepControl.Monad.Trans.RWS.RWST3 r w s) instance (GHC.Base.Monoid w, Control.Monad.IO.Class.MonadIO m1, GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2, DeepControl.Monad.Monad3 m3) => Control.Monad.IO.Class.MonadIO (DeepControl.Monad.Trans.RWS.RWST3 r w s m1 m2 m3) instance GHC.Base.Monoid w => DeepControl.Monad.Trans.MonadTrans3Down (DeepControl.Monad.Trans.RWS.RWST3 r w s) instance GHC.Base.Monoid w => DeepControl.Monad.Trans.MonadTransFold3 (DeepControl.Monad.Trans.RWS.RWST3 r w s) instance GHC.Base.Monoid w => DeepControl.Monad.Trans.MonadTransCover3 (DeepControl.Monad.Trans.RWS.RWST3 r w s) -- | This module extended Reader Monad in mtl(monad-transformer-library). module DeepControl.Monad.Trans.Reader newtype ReaderT2 r m1 m2 a ReaderT2 :: (r -> m1 (m2 a)) -> ReaderT2 r m1 m2 a [runReaderT2] :: ReaderT2 r m1 m2 a -> r -> m1 (m2 a) mapReaderT2 :: (m1 (m2 a) -> n1 (n2 b)) -> ReaderT2 r m1 m2 a -> ReaderT2 r n1 n2 b newtype ReaderT3 r m1 m2 m3 a ReaderT3 :: (r -> m1 (m2 (m3 a))) -> ReaderT3 r m1 m2 m3 a [runReaderT3] :: ReaderT3 r m1 m2 m3 a -> r -> m1 (m2 (m3 a)) mapReaderT3 :: (m1 (m2 (m3 a)) -> n1 (n2 (n3 b))) -> ReaderT3 r m1 m2 m3 a -> ReaderT3 r n1 n2 n3 b instance DeepControl.Monad.Trans.MonadTransDown (Control.Monad.Trans.Reader.ReaderT r) instance DeepControl.Monad.Trans.MonadTransCover (Control.Monad.Trans.Reader.ReaderT s) instance (GHC.Base.Functor m1, GHC.Base.Functor m2) => GHC.Base.Functor (DeepControl.Monad.Trans.Reader.ReaderT2 r m1 m2) instance (GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2) => GHC.Base.Applicative (DeepControl.Monad.Trans.Reader.ReaderT2 s m1 m2) instance (GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2) => GHC.Base.Monad (DeepControl.Monad.Trans.Reader.ReaderT2 r m1 m2) instance (GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2) => Control.Monad.Reader.Class.MonadReader r (DeepControl.Monad.Trans.Reader.ReaderT2 r m1 m2) instance DeepControl.Monad.Trans.MonadTrans2 (DeepControl.Monad.Trans.Reader.ReaderT2 r) instance (Control.Monad.IO.Class.MonadIO m1, GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2) => Control.Monad.IO.Class.MonadIO (DeepControl.Monad.Trans.Reader.ReaderT2 r m1 m2) instance DeepControl.Monad.Trans.MonadTrans2Down (DeepControl.Monad.Trans.Reader.ReaderT2 r) instance DeepControl.Monad.Trans.MonadTransFold2 (DeepControl.Monad.Trans.Reader.ReaderT2 r) instance DeepControl.Monad.Trans.MonadTransCover2 (DeepControl.Monad.Trans.Reader.ReaderT2 r) instance (GHC.Base.Functor m1, GHC.Base.Functor m2, GHC.Base.Functor m3) => GHC.Base.Functor (DeepControl.Monad.Trans.Reader.ReaderT3 r m1 m2 m3) instance (GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2, DeepControl.Monad.Monad3 m3) => GHC.Base.Applicative (DeepControl.Monad.Trans.Reader.ReaderT3 s m1 m2 m3) instance (GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2, DeepControl.Monad.Monad3 m3) => GHC.Base.Monad (DeepControl.Monad.Trans.Reader.ReaderT3 r m1 m2 m3) instance (GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2, DeepControl.Monad.Monad3 m3) => Control.Monad.Reader.Class.MonadReader r (DeepControl.Monad.Trans.Reader.ReaderT3 r m1 m2 m3) instance DeepControl.Monad.Trans.MonadTrans3 (DeepControl.Monad.Trans.Reader.ReaderT3 r) instance (Control.Monad.IO.Class.MonadIO m1, GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2, DeepControl.Monad.Monad3 m3) => Control.Monad.IO.Class.MonadIO (DeepControl.Monad.Trans.Reader.ReaderT3 r m1 m2 m3) instance DeepControl.Monad.Trans.MonadTrans3Down (DeepControl.Monad.Trans.Reader.ReaderT3 r) instance DeepControl.Monad.Trans.MonadTransFold3 (DeepControl.Monad.Trans.Reader.ReaderT3 r) instance DeepControl.Monad.Trans.MonadTransCover3 (DeepControl.Monad.Trans.Reader.ReaderT3 r) -- | This module extended State Monad in mtl(monad-transformer-library). module DeepControl.Monad.Trans.State newtype StateT2 s m1 m2 a StateT2 :: (s -> m1 (m2 (a, s))) -> StateT2 s m1 m2 a [runStateT2] :: StateT2 s m1 m2 a -> (s -> m1 (m2 (a, s))) evalStateT2 :: (Monad m1, Monad2 m2) => StateT2 s m1 m2 a -> s -> m1 (m2 a) execStateT2 :: (Monad m1, Monad2 m2) => StateT2 s m1 m2 a -> s -> m1 (m2 s) mapStateT2 :: (m1 (m2 (a, s)) -> n1 (n2 (b, s))) -> StateT2 s m1 m2 a -> StateT2 s n1 n2 b withStateT2 :: (s -> s) -> StateT2 s m1 m2 a -> StateT2 s m1 m2 a newtype StateT3 s m1 m2 m3 a StateT3 :: (s -> m1 (m2 (m3 (a, s)))) -> StateT3 s m1 m2 m3 a [runStateT3] :: StateT3 s m1 m2 m3 a -> (s -> m1 (m2 (m3 (a, s)))) evalStateT3 :: (Monad m1, Monad2 m2, Monad3 m3) => StateT3 s m1 m2 m3 a -> s -> m1 (m2 (m3 a)) execStateT3 :: (Monad m1, Monad2 m2, Monad3 m3) => StateT3 s m1 m2 m3 a -> s -> m1 (m2 (m3 s)) mapStateT3 :: (m1 (m2 (m3 (a, s))) -> n1 (n2 (n3 (b, s)))) -> StateT3 s m1 m2 m3 a -> StateT3 s n1 n2 n3 b withStateT3 :: (s -> s) -> StateT3 s m1 m2 m3 a -> StateT3 s m1 m2 m3 a instance DeepControl.Monad.Trans.MonadTransDown (Control.Monad.Trans.State.Lazy.StateT s) instance DeepControl.Monad.Trans.MonadTransCover (Control.Monad.Trans.State.Lazy.StateT s) instance (GHC.Base.Functor m1, GHC.Base.Functor m2) => GHC.Base.Functor (DeepControl.Monad.Trans.State.StateT2 s m1 m2) instance (GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2) => GHC.Base.Applicative (DeepControl.Monad.Trans.State.StateT2 s m1 m2) instance (GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2) => GHC.Base.Monad (DeepControl.Monad.Trans.State.StateT2 s m1 m2) instance (GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2) => Control.Monad.State.Class.MonadState s (DeepControl.Monad.Trans.State.StateT2 s m1 m2) instance DeepControl.Monad.Trans.MonadTrans2 (DeepControl.Monad.Trans.State.StateT2 s) instance (Control.Monad.IO.Class.MonadIO m1, GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2) => Control.Monad.IO.Class.MonadIO (DeepControl.Monad.Trans.State.StateT2 s m1 m2) instance DeepControl.Monad.Trans.MonadTrans2Down (DeepControl.Monad.Trans.State.StateT2 s) instance DeepControl.Monad.Trans.MonadTransFold2 (DeepControl.Monad.Trans.State.StateT2 s) instance DeepControl.Monad.Trans.MonadTransCover2 (DeepControl.Monad.Trans.State.StateT2 w) instance (GHC.Base.Functor m1, GHC.Base.Functor m2, GHC.Base.Functor m3) => GHC.Base.Functor (DeepControl.Monad.Trans.State.StateT3 s m1 m2 m3) instance (GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2, DeepControl.Monad.Monad3 m3) => GHC.Base.Applicative (DeepControl.Monad.Trans.State.StateT3 s m1 m2 m3) instance (GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2, DeepControl.Monad.Monad3 m3) => GHC.Base.Monad (DeepControl.Monad.Trans.State.StateT3 s m1 m2 m3) instance (GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2, DeepControl.Monad.Monad3 m3) => Control.Monad.State.Class.MonadState s (DeepControl.Monad.Trans.State.StateT3 s m1 m2 m3) instance DeepControl.Monad.Trans.MonadTrans3 (DeepControl.Monad.Trans.State.StateT3 s) instance (Control.Monad.IO.Class.MonadIO m1, GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2, DeepControl.Monad.Monad3 m3) => Control.Monad.IO.Class.MonadIO (DeepControl.Monad.Trans.State.StateT3 s m1 m2 m3) instance DeepControl.Monad.Trans.MonadTrans3Down (DeepControl.Monad.Trans.State.StateT3 s) instance DeepControl.Monad.Trans.MonadTransFold3 (DeepControl.Monad.Trans.State.StateT3 s) instance DeepControl.Monad.Trans.MonadTransCover3 (DeepControl.Monad.Trans.State.StateT3 s) -- | This module extended Writer Monad in mtl(monad-transformer-library). module DeepControl.Monad.Trans.Writer newtype WriterT2 w m1 m2 a WriterT2 :: m1 (m2 (a, w)) -> WriterT2 w m1 m2 a [runWriterT2] :: WriterT2 w m1 m2 a -> m1 (m2 (a, w)) execWriterT2 :: (Monad m1, Monad2 m2) => WriterT2 w m1 m2 a -> m1 (m2 w) mapWriterT2 :: (m1 (m2 (a, w)) -> n1 (n2 (b, w'))) -> WriterT2 w m1 m2 a -> WriterT2 w' n1 n2 b newtype WriterT3 w m1 m2 m3 a WriterT3 :: m1 (m2 (m3 (a, w))) -> WriterT3 w m1 m2 m3 a [runWriterT3] :: WriterT3 w m1 m2 m3 a -> m1 (m2 (m3 (a, w))) execWriterT3 :: (Monad m1, Monad2 m2, Monad3 m3) => WriterT3 w m1 m2 m3 a -> m1 (m2 (m3 w)) mapWriterT3 :: (m1 (m2 (m3 (a, w))) -> n1 (n2 (n3 (b, w')))) -> WriterT3 w m1 m2 m3 a -> WriterT3 w' n1 n2 n3 b instance GHC.Base.Monoid w => DeepControl.Monad.Monad2 (Control.Monad.Trans.Writer.Lazy.Writer w) instance GHC.Base.Monoid w => DeepControl.Monad.Monad3 (Control.Monad.Trans.Writer.Lazy.Writer w) instance GHC.Base.Monoid w => DeepControl.Monad.Monad4 (Control.Monad.Trans.Writer.Lazy.Writer w) instance GHC.Base.Monoid w => DeepControl.Monad.Monad5 (Control.Monad.Trans.Writer.Lazy.Writer w) instance GHC.Base.Monoid w => DeepControl.Monad.Trans.MonadTrans_ (Control.Monad.Trans.Writer.Lazy.WriterT w) instance GHC.Base.Monoid w => DeepControl.Monad.Trans.MonadTransDown (Control.Monad.Trans.Writer.Lazy.WriterT w) instance GHC.Base.Monoid w => DeepControl.Monad.Trans.MonadTransCover (Control.Monad.Trans.Writer.Lazy.WriterT w) instance (GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2) => GHC.Base.Functor (DeepControl.Monad.Trans.Writer.WriterT2 w m1 m2) instance (GHC.Base.Monoid w, GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2) => GHC.Base.Applicative (DeepControl.Monad.Trans.Writer.WriterT2 w m1 m2) instance (GHC.Base.Monoid w, GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2) => GHC.Base.Monad (DeepControl.Monad.Trans.Writer.WriterT2 w m1 m2) instance (GHC.Base.Monoid w, GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2) => Control.Monad.Writer.Class.MonadWriter w (DeepControl.Monad.Trans.Writer.WriterT2 w m1 m2) instance GHC.Base.Monoid w => DeepControl.Monad.Trans.MonadTrans2 (DeepControl.Monad.Trans.Writer.WriterT2 w) instance (GHC.Base.Monoid w, Control.Monad.IO.Class.MonadIO m1, GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2) => Control.Monad.IO.Class.MonadIO (DeepControl.Monad.Trans.Writer.WriterT2 w m1 m2) instance GHC.Base.Monoid w => DeepControl.Monad.Trans.MonadTrans2Down (DeepControl.Monad.Trans.Writer.WriterT2 w) instance GHC.Base.Monoid w => DeepControl.Monad.Trans.MonadTransFold2 (DeepControl.Monad.Trans.Writer.WriterT2 w) instance GHC.Base.Monoid w => DeepControl.Monad.Trans.MonadTransCover2 (DeepControl.Monad.Trans.Writer.WriterT2 w) instance (GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2, DeepControl.Monad.Monad3 m3) => GHC.Base.Functor (DeepControl.Monad.Trans.Writer.WriterT3 w m1 m2 m3) instance (GHC.Base.Monoid w, GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2, DeepControl.Monad.Monad3 m3) => GHC.Base.Applicative (DeepControl.Monad.Trans.Writer.WriterT3 w m1 m2 m3) instance (GHC.Base.Monoid w, GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2, DeepControl.Monad.Monad3 m3) => GHC.Base.Monad (DeepControl.Monad.Trans.Writer.WriterT3 w m1 m2 m3) instance (GHC.Base.Monoid w, GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2, DeepControl.Monad.Monad3 m3) => Control.Monad.Writer.Class.MonadWriter w (DeepControl.Monad.Trans.Writer.WriterT3 w m1 m2 m3) instance GHC.Base.Monoid w => DeepControl.Monad.Trans.MonadTrans3 (DeepControl.Monad.Trans.Writer.WriterT3 w) instance (GHC.Base.Monoid w, Control.Monad.IO.Class.MonadIO m1, GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2, DeepControl.Monad.Monad3 m3) => Control.Monad.IO.Class.MonadIO (DeepControl.Monad.Trans.Writer.WriterT3 w m1 m2 m3) instance GHC.Base.Monoid w => DeepControl.Monad.Trans.MonadTrans3Down (DeepControl.Monad.Trans.Writer.WriterT3 w) instance GHC.Base.Monoid w => DeepControl.Monad.Trans.MonadTransFold3 (DeepControl.Monad.Trans.Writer.WriterT3 w) instance GHC.Base.Monoid w => DeepControl.Monad.Trans.MonadTransCover3 (DeepControl.Monad.Trans.Writer.WriterT3 w) module DeepControl.Arrow newtype Kleisli2 m1 m2 a b Kleisli2 :: (a -> m1 (m2 b)) -> Kleisli2 m1 m2 a b [runKleisli2] :: Kleisli2 m1 m2 a b -> a -> m1 (m2 b) newtype Kleisli3 m1 m2 m3 a b Kleisli3 :: (a -> m1 (m2 (m3 b))) -> Kleisli3 m1 m2 m3 a b [runKleisli3] :: Kleisli3 m1 m2 m3 a b -> a -> m1 (m2 (m3 b)) newtype Kleisli4 m1 m2 m3 m4 a b Kleisli4 :: (a -> m1 (m2 (m3 (m4 b)))) -> Kleisli4 m1 m2 m3 m4 a b [runKleisli4] :: Kleisli4 m1 m2 m3 m4 a b -> a -> m1 (m2 (m3 (m4 b))) newtype Kleisli5 m1 m2 m3 m4 m5 a b Kleisli5 :: (a -> m1 (m2 (m3 (m4 (m5 b))))) -> Kleisli5 m1 m2 m3 m4 m5 a b [runKleisli5] :: Kleisli5 m1 m2 m3 m4 m5 a b -> a -> m1 (m2 (m3 (m4 (m5 b)))) instance (GHC.Base.Applicative m1, GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2) => Control.Category.Category (DeepControl.Arrow.Kleisli2 m1 m2) instance (GHC.Base.Applicative m1, GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2) => Control.Arrow.Arrow (DeepControl.Arrow.Kleisli2 m1 m2) instance (GHC.Base.Applicative m1, GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2, DeepControl.Monad.Monad3 m3) => Control.Category.Category (DeepControl.Arrow.Kleisli3 m1 m2 m3) instance (GHC.Base.Applicative m1, GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2, DeepControl.Monad.Monad3 m3) => Control.Arrow.Arrow (DeepControl.Arrow.Kleisli3 m1 m2 m3) instance (GHC.Base.Applicative m1, GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2, DeepControl.Monad.Monad3 m3, DeepControl.Monad.Monad4 m4) => Control.Category.Category (DeepControl.Arrow.Kleisli4 m1 m2 m3 m4) instance (GHC.Base.Applicative m1, GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2, DeepControl.Monad.Monad3 m3, DeepControl.Monad.Monad4 m4) => Control.Arrow.Arrow (DeepControl.Arrow.Kleisli4 m1 m2 m3 m4) instance (GHC.Base.Applicative m1, GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2, DeepControl.Monad.Monad3 m3, DeepControl.Monad.Monad4 m4, DeepControl.Monad.Monad5 m5) => Control.Category.Category (DeepControl.Arrow.Kleisli5 m1 m2 m3 m4 m5) instance (GHC.Base.Applicative m1, GHC.Base.Monad m1, DeepControl.Monad.Monad2 m2, DeepControl.Monad.Monad3 m3, DeepControl.Monad.Monad4 m4, DeepControl.Monad.Monad5 m5) => Control.Arrow.Arrow (DeepControl.Arrow.Kleisli5 m1 m2 m3 m4 m5)