-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | A backtracking logic-programming monad.
--   
--   Adapted from the paper Backtracking, Interleaving, and Terminating
--   Monad Transformers by Oleg Kiselyov, Chung-chieh Shan, Daniel P.
--   Friedman, Amr Sabry.
@package logict
@version 0.8.2.0

-- | Adapted from the paper Backtracking, Interleaving, and Terminating
--   Monad Transformers by Oleg Kiselyov, Chung-chieh Shan, Daniel P.
--   Friedman, Amr Sabry. Note that the paper uses MonadPlus
--   vocabulary (mzero and mplus), while examples below
--   prefer empty and <|> from Alternative.
module Control.Monad.Logic.Class

-- | A backtracking, logic programming monad.
--   
--   This package offers one implementation of MonadLogic:
--   LogicT. Other notable implementations:
--   
--   
--   
--   
- https://hackage.haskell.org/package/list-t/docs/ListT.html#t:ListT
--   
--   
- https://hackage.haskell.org/package/logict-sequence/docs/Control-Monad-Logic-Sequence.html#t:SeqT
--   
--   
- https://hackage.haskell.org/package/logict-state/docs/Control-Monad-LogicState.html#t:LogicStateT
--   
--   
- https://hackage.haskell.org/package/streamt/docs/Control-Monad-Stream.html#t:StreamT
--   
class (Monad m, Alternative m) => MonadLogic (m :: Type -> Type)

-- | Attempts to split the computation, giving access to the first
--   result. Satisfies the following laws:
--   
--   
--   msplit empty          == pure Nothing
--   msplit (pure a <|> m) == pure (Just (a, m))
--   
msplit :: MonadLogic m => m a -> m (Maybe (a, m a))

-- | Fair disjunction. It is possible for a logical computation to
--   have an infinite number of potential results, for instance:
--   
--   
--   odds = pure 1 <|> fmap (+ 2) odds
--   
--   
--   Such computations can cause problems in some circumstances. Consider:
--   
--   
--   two = do x <- odds <|> pure 2
--            if even x then pure x else empty
--   
--   
--   
--   >>> observe two
--   ...never completes...
--   
--   
--   Such a computation may never consider pure 2, and
--   therefore even observe two will never return any
--   results. By contrast, using interleave in place of
--   <|> ensures fair consideration of both branches of a
--   disjunction.
--   
--   
--   fairTwo = do x <- odds `interleave` pure 2
--                if even x then pure x else empty
--   
--   
--   
--   >>> observe fairTwo
--   2
--   
--   
--   Note that even with interleave this computation will never
--   terminate after returning 2: only the first value can be safely
--   observed, after which each odd value becomes empty (equivalent
--   to Prolog's fail) which does not stop the evaluation but
--   indicates there is no value to return yet.
--   
--   Unlike <|>, interleave is not associative:
--   
--   
--   >>> let x = [1,2,3]; y = [4,5,6]; z = [7,8,9] :: [Int]
--   
--   >>> x `interleave` y
--   [1,4,2,5,3,6]
--   
--   >>> (x `interleave` y) `interleave` z
--   [1,7,4,8,2,9,5,3,6]
--   
--   >>> y `interleave` z
--   [4,7,5,8,6,9]
--   
--   >>> x `interleave` (y `interleave` z)
--   [1,4,2,7,3,5,8,6,9]
--   
interleave :: MonadLogic m => m a -> m a -> m a

-- | Fair conjunction. Similarly to the previous function, consider
--   the distributivity law, naturally expected from MonadPlus:
--   
--   
--   (a <|> b) >>= k = (a >>= k) <|> (b >>= k)
--   
--   
--   If a >>= k can backtrack arbitrarily
--   many times, b >>= k may never be
--   considered. In logic statements, "backtracking" is the process of
--   discarding the current possible solution value and returning to a
--   previous decision point where a new value can be obtained and tried.
--   For example:
--   
--   
--   >>> do { x <- pure 0 <|> pure 1 <|> pure 2; if even x then pure x else empty } :: [Int]
--   [0,2]
--   
--   
--   Here, the x value can be produced three times, where
--   <|> represents the decision points of that production.
--   The subsequent if statement specifies empty (fail) if
--   x is odd, causing it to be discarded and a return to an
--   <|> decision point to get the next x.
--   
--   The statement "a >>= k can backtrack
--   arbitrarily many times" means that the computation is resulting in
--   empty and that a has an infinite number of
--   <|> applications to return to. This is called a
--   conjunctive computation because the logic for a and
--   k must both succeed (i.e. pure a value instead of
--   empty).
--   
--   Similar to the way interleave allows both branches of a
--   disjunctive computation, the >>- operator takes care to
--   consider both branches of a conjunctive computation.
--   
--   Consider the operation:
--   
--   
--   odds = pure 1 <|> fmap (2 +) odds
--   
--   oddsPlus n = odds >>= \a -> pure (a + n)
--   
--   g = do x <- (pure 0 <|> pure 1) >>= oddsPlus
--          if even x then pure x else empty
--   
--   
--   
--   >>> observeMany 3 g
--   ...never completes...
--   
--   
--   This will never produce any value because all values produced by the
--   do program come from the pure 1 driven
--   operation (adding one to the sequence of odd values, resulting in the
--   even values that are allowed by the test in the second line), but the
--   pure 0 input to oddsPlus generates an
--   infinite number of empty failures so the even values generated
--   by the pure 1 alternative are never seen. Using
--   interleave here instead of <|> does not help due
--   to the aforementioned distributivity law.
--   
--   Also note that the do notation desugars to >>=
--   bind operations, so the following would also fail:
--   
--   
--   do a <- pure 0 <|> pure 1
--      x <- oddsPlus a
--      if even x then pure x else empty
--   
--   
--   The solution is to use the >>- in place of the normal
--   monadic bind operation >>= when fairness between
--   alternative productions is needed in a conjunction of statements
--   (rules):
--   
--   
--   h = do x <- (pure 0 <|> pure 1) >>- oddsPlus
--          if even x then pure x else empty
--   
--   
--   
--   >>> observeMany 3 h
--   [2,4,6]
--   
--   
--   However, a bit of care is needed when using >>- because,
--   unlike >>=, it is not associative. For example:
--   
--   
--   >>> let m = [2,7] :: [Int]
--   
--   >>> let k x = [x, x + 1]
--   
--   >>> let h x = [x, x * 2]
--   
--   >>> m >>= (\x -> k x >>= h)
--   [2,4,3,6,7,14,8,16]
--   
--   >>> (m >>= k) >>= h -- same as above
--   [2,4,3,6,7,14,8,16]
--   
--   >>> m >>- (\x -> k x >>- h)
--   [2,7,3,8,4,14,6,16]
--   
--   >>> (m >>- k) >>- h -- central elements are different
--   [2,7,4,3,14,8,6,16]
--   
--   
--   This means that the following will be productive:
--   
--   
--   (pure 0 <|> pure 1) >>-
--     oddsPlus >>-
--       \x -> if even x then pure x else empty
--   
--   
--   Which is equivalent to
--   
--   
--   ((pure 0 <|> pure 1) >>- oddsPlus) >>-
--     (\x -> if even x then pure x else empty)
--   
--   
--   But the following will not be productive:
--   
--   
--   (pure 0 <|> pure 1) >>-
--     (\a -> (oddsPlus a >>- \x -> if even x then pure x else empty))
--   
--   
--   Since do notation desugaring results in the latter, the
--   RebindableSyntax or QualifiedDo language pragmas
--   cannot easily be used either. Instead, it is recommended to carefully
--   use explicit >>- only when needed.
--   
--   Here is an action of (>>-) on lists:
--   
--   
--   >>> take 20 $ [100,200..500] >>- (\x -> map (x +) [1..])
--   [101,201,102,301,103,202,104,401,105,203,106,302,107,204,108,501,109,205,110,303]
--   
--   
--   The result is map (100 +) [1..] interleaved with
--   [200,300..500] >>- (x -> map (x +) [1..]). You can
--   see that a half of the numbers starts from 1, a quarter starts from 2,
--   and so on exponentially. One could argue that (>>-) is a
--   very unfair conjunction!
(>>-) :: MonadLogic m => m a -> (a -> m b) -> m b

-- | Pruning. Selects one result out of many. Useful for when
--   multiple results of a computation will be equivalent, or should be
--   treated as such.
--   
--   As an example, here's a way to determine if a number is
--   composite (has non-trivial integer divisors, i.e. not a prime
--   number):
--   
--   
--   choose = foldr ((<|>) . pure) empty
--   
--   divisors n = do a <- choose [2..n-1]
--                   b <- choose [2..n-1]
--                   guard (a * b == n)
--                   pure (a, b)
--   
--   composite_ v = do _ <- divisors v
--                     pure "Composite"
--   
--   
--   While this works as intended, it actually does too much work:
--   
--   
--   >>> observeAll (composite_ 20)
--   ["Composite", "Composite", "Composite", "Composite"]
--   
--   
--   Because there are multiple divisors of 20, and they can also occur in
--   either order:
--   
--   
--   >>> observeAll (divisors 20)
--   [(2,10), (4,5), (5,4), (10,2)]
--   
--   
--   Clearly one could just use observe here to get the first
--   non-prime result, but if the call to composite is in the
--   middle of other logic code then use once instead.
--   
--   
--   composite v = do _ <- once (divisors v)
--                    pure "Composite"
--   
--   
--   
--   >>> observeAll (composite 20)
--   ["Composite"]
--   
once :: MonadLogic m => m a -> m a

-- | Inverts a logic computation. If m succeeds with at
--   least one value, lnot m fails. If m fails,
--   then lnot m succeeds with the value ().
--   
--   For example, evaluating if a number is prime can be based on the
--   failure to find divisors of a number:
--   
--   
--   choose = foldr ((<|>) . pure) empty
--   
--   divisors n = do d <- choose [2..n-1]
--                   guard (n `rem` d == 0)
--                   pure d
--   
--   prime v = do _ <- lnot (divisors v)
--                pure True
--   
--   
--   
--   >>> observeAll (prime 20)
--   []
--   
--   >>> observeAll (prime 19)
--   [True]
--   
--   
--   Here if divisors never succeeds, then the lnot will
--   succeed and the number will be declared as prime.
lnot :: MonadLogic m => m a -> m ()

-- | Logical conditional. The equivalent of Prolog's
--   soft-cut. If its first argument succeeds at all, then the results
--   will be fed into the success branch. Otherwise, the failure branch is
--   taken. The failure branch is never considered if the first argument
--   has any successes. The ifte function satisfies the following
--   laws:
--   
--   
--   ifte (pure a) th el       == th a
--   ifte empty th el          == el
--   ifte (pure a <|> m) th el == th a <|> (m >>= th)
--   
--   
--   For example, the previous prime function returned nothing if
--   the number was not prime, but if it should return False
--   instead, the following can be used:
--   
--   
--   choose = foldr ((<|>) . pure) empty
--   
--   divisors n = do d <- choose [2..n-1]
--                   guard (n `rem` d == 0)
--                   pure d
--   
--   prime v = once (ifte (divisors v)
--                     (const (pure False))
--                     (pure True))
--   
--   
--   
--   >>> observeAll (prime 20)
--   [False]
--   
--   >>> observeAll (prime 19)
--   [True]
--   
--   
--   Notice that this cannot be done with a simple if-then-else
--   because divisors either generates values or it does not, so
--   there's no "false" condition to check with a simple if
--   statement.
ifte :: MonadLogic m => m a -> (a -> m b) -> m b -> m b
infixl 1 >>-

-- | The inverse of msplit. Satisfies the following law:
--   
--   
--   msplit m >>= reflect == m
--   
reflect :: Alternative m => Maybe (a, m a) -> m a
instance GHC.Internal.Exception.Type.Exception Control.Monad.Logic.Class.MyException
instance Control.Monad.Logic.Class.MonadLogic []
instance Control.Monad.Logic.Class.MonadLogic m => Control.Monad.Logic.Class.MonadLogic (Control.Monad.Trans.Reader.ReaderT e m)
instance (Control.Monad.Logic.Class.MonadLogic m, GHC.Internal.Base.MonadPlus m) => Control.Monad.Logic.Class.MonadLogic (Control.Monad.Trans.State.Lazy.StateT s m)
instance (Control.Monad.Logic.Class.MonadLogic m, GHC.Internal.Base.MonadPlus m) => Control.Monad.Logic.Class.MonadLogic (Control.Monad.Trans.State.Strict.StateT s m)
instance (GHC.Internal.Base.Monoid w, Control.Monad.Logic.Class.MonadLogic m, GHC.Internal.Base.MonadPlus m) => Control.Monad.Logic.Class.MonadLogic (Control.Monad.Trans.Writer.CPS.WriterT w m)
instance GHC.Internal.Show.Show Control.Monad.Logic.Class.MyException

-- | Adapted from the paper Backtracking, Interleaving, and Terminating
--   Monad Transformers by Oleg Kiselyov, Chung-chieh Shan, Daniel P.
--   Friedman, Amr Sabry. Note that the paper uses MonadPlus
--   vocabulary (mzero and mplus), while examples below
--   prefer empty and <|> from Alternative.
module Control.Monad.Logic

-- | The basic Logic monad, for performing backtracking computations
--   returning values (e.g. Logic a will return values of
--   type a).
--   
--   It's important to remember that Logic on its own is just a
--   lawful list monad, behaving exactly as instance Monad
--   []. One should explicitly use methods of MonadLogic
--   such as (>>-) and interleave to get fair
--   conjunction / disjunction. Note that usual lists have an instance of
--   MonadLogic, so maybe you don't need Logic at all.
--   
--   Technical perspective. Logic is a Boehm-Berarducci
--   encoding of lists. Speaking plainly, its type is identical (up to
--   Identity wrappers) to foldr applied to a given list. And
--   this list itself can be reconstructed by supplying (:) and
--   [].
--   
--   
--   import Data.Functor.Identity
--   
--   fromList :: [a] -> Logic a
--   fromList xs = LogicT $ \cons nil -> foldr cons nil xs
--   
--   toList :: Logic a -> [a]
--   toList (LogicT fld) = runIdentity $ fld (\x (Identity xs) -> Identity (x : xs)) (Identity [])
--   
--   
--   Here is a systematic derivation of the isomorphism. We start with
--   observing that [a] is isomorphic to a fix point of a
--   non-recursive base algebra Fix (ListF a):
--   
--   
--   newtype Fix f = Fix (f (Fix f))
--   data ListF a r = ConsF a r | NilF deriving (Functor)
--   
--   cata :: Functor f => (f r -> r) -> Fix f -> r
--   cata f = go where go (Fix x) = f (fmap go x)
--   
--   from :: [a] -> Fix (ListF a)
--   from = foldr (\a acc -> Fix (ConsF a acc)) (Fix NilF)
--   
--   to :: Fix (ListF a) -> [a]
--   to = cata (\case ConsF a r -> a : r; NilF -> [])
--   
--   
--   Further, Fix (ListF a) is isomorphic to
--   Boehm-Berarducci encoding ListC a:
--   
--   
--   newtype ListC a = ListC (forall r. (ListF a r -> r) -> r)
--   
--   from :: Fix (ListF a) -> ListC a
--   from xs = ListC (\f -> cata f xs)
--   
--   to :: ListC a -> Fix (ListF a)
--   to (ListC f) = f Fix
--   
--   
--   Finally, ListF a r → r is
--   isomorphic to a pair (a → r → r,
--   r), so ListC is isomorphic to the Logic type
--   modulo Identity wrappers:
--   
--   
--   newtype Logic a = Logic (forall r. (a -> r -> r) -> r -> r)
--   
--   
--   And wrapping every occurence of r into m gives us
--   LogicT:
--   
--   
--   newtype LogicT m a = Logic (forall r. (a -> m r -> m r) -> m r -> m r)
--   
type Logic = LogicT Identity

-- | A smart constructor for Logic computations.
logic :: (forall r. () => (a -> r -> r) -> r -> r) -> Logic a

-- | Runs a Logic computation with the specified initial success and
--   failure continuations.
--   
--   
--   >>> runLogic empty (+) 0
--   0
--   
--   
--   
--   >>> runLogic (pure 5 <|> pure 3 <|> empty) (+) 0
--   8
--   
--   
--   When invoked with (:) and [] as arguments, reveals a
--   half of the isomorphism between Logic and lists. See
--   description of observeAll for the other half.
runLogic :: Logic a -> (a -> r -> r) -> r -> r

-- | Extracts the first result from a Logic computation, failing if
--   there are no results.
--   
--   
--   >>> observe (pure 5 <|> pure 3 <|> empty)
--   5
--   
--   
--   
--   >>> observe empty
--   *** Exception: No answer.
--   
--   
--   Since Logic is isomorphic to a list, observe is
--   analogous to head.
observe :: Logic a -> a

-- | Extracts up to a given number of results from a Logic
--   computation.
--   
--   
--   >>> let nats = pure 0 <|> fmap (+ 1) nats
--   
--   >>> observeMany 5 nats
--   [0,1,2,3,4]
--   
--   
--   Since Logic is isomorphic to a list, observeMany is
--   analogous to take.
observeMany :: Int -> Logic a -> [a]

-- | Extracts all results from a Logic computation.
--   
--   
--   >>> observeAll (pure 5 <|> empty <|> empty <|> pure 3 <|> empty)
--   [5,3]
--   
--   
--   observeAll reveals a half of the isomorphism between
--   Logic and lists. See description of runLogic for the
--   other half.
observeAll :: Logic a -> [a]

-- | A monad transformer for performing backtracking computations layered
--   over another monad m.
--   
--   When m is Identity, LogicT m becomes
--   isomorphic to a list (see Logic). Thus LogicT m
--   for non-trivial m can be imagined as a list, pattern matching
--   on which causes monadic effects.
--   
--   It's important to remember that LogicT on its own is just a
--   lawful list monad transformer, adding a nondeterministic effect, and
--   its Monad instance behaves just as instance
--   Monad []:
--   
--   
--   >>> :set -XOverloadedLists
--   
--   >>> observeMany 9 $ do {x <- [100,200] :: Logic Int; fmap (+x) [1..]}
--   [101,102,103,104,105,106,107,108,109]
--   
--   >>> observeMany 9 $ do {[100,200] >>= \x -> fmap (+x) [1..] :: Logic Int}
--   [101,102,103,104,105,106,107,108,109]
--   
--   
--   One should explicitly use methods of MonadLogic such as
--   (>>-) and interleave to get fair conjunction /
--   disjunction:
--   
--   
--   >>> observeMany 9 $ do {[100,200] >>- \x -> fmap (+x) [1..] :: Logic Int}
--   [101,201,102,202,103,203,104,204,105]
--   
newtype LogicT (m :: Type -> Type) a
LogicT :: (forall r. () => (a -> m r -> m r) -> m r -> m r) -> LogicT (m :: Type -> Type) a
[unLogicT] :: LogicT (m :: Type -> Type) a -> forall r. () => (a -> m r -> m r) -> m r -> m r

-- | Runs a LogicT computation with the specified initial success
--   and failure continuations.
--   
--   The second argument ("success continuation") takes one result of the
--   LogicT computation and the monad to run for any subsequent
--   matches.
--   
--   The third argument ("failure continuation") is called when the
--   LogicT cannot produce any more results.
--   
--   For example:
--   
--   
--   >>> yieldWords = foldr ((<|>) . pure) empty
--   
--   >>> showEach wrd nxt = putStrLn wrd >> nxt
--   
--   >>> runLogicT (yieldWords ["foo", "bar"]) showEach (putStrLn "none!")
--   foo
--   bar
--   none!
--   
--   >>> runLogicT (yieldWords []) showEach (putStrLn "none!")
--   none!
--   
--   >>> showFirst wrd _ = putStrLn wrd
--   
--   >>> runLogicT (yieldWords ["foo", "bar"]) showFirst (putStrLn "none!")
--   foo
--   
runLogicT :: LogicT m a -> (a -> m r -> m r) -> m r -> m r

-- | Extracts the first result from a LogicT computation, failing if
--   there are no results at all.
observeT :: MonadFail m => LogicT m a -> m a

-- | Extracts up to a given number of results from a LogicT
--   computation.
observeManyT :: Monad m => Int -> LogicT m a -> m [a]

-- | Extracts all results from a LogicT computation, unless blocked
--   by the underlying monad.
--   
--   For example, given
--   
--   
--   >>> let nats = pure 0 <|> fmap (+ 1) nats
--   
--   
--   some monads (like Identity, Reader, Writer, and
--   State) will be productive:
--   
--   
--   >>> take 5 $ runIdentity (observeAllT nats)
--   [0,1,2,3,4]
--   
--   
--   but others (like ExceptT, and ContT) will not:
--   
--   
--   >>> take 20 <$> runExcept (observeAllT nats)
--   
--   
--   In general, if the underlying monad manages control flow then
--   observeAllT may be unproductive under infinite branching, and
--   observeManyT should be used instead.
observeAllT :: Applicative m => LogicT m a -> m [a]

-- | Convert from LogicT to an arbitrary logic-like monad
--   transformer, such as list-t or logict-sequence
--   
--   For example, to show a representation of the structure of a
--   LogicT computation, l, over a data-like Monad
--   (such as [], Data.Sequence.Seq, etc.), you could
--   write
--   
--   
--   import ListT (ListT)
--   
--   show $ fromLogicT @ListT l
--   
fromLogicT :: forall t (m :: Type -> Type) a. (Alternative (t m), MonadTrans t, Monad m, Monad (t m)) => LogicT m a -> t m a

-- | Convert from LogicT m to an arbitrary logic-like
--   monad, such as [].
--   
--   Examples:
--   
--   
--   fromLogicT = fromLogicTWith d
--   hoistLogicT f = fromLogicTWith (lift . f)
--   embedLogicT f = fromLogicTWith f
--   
--   
--   The first argument should be a monad morphism. to produce
--   sensible results.
fromLogicTWith :: (Applicative m, Monad n, Alternative n) => (forall x. () => m x -> n x) -> LogicT m a -> n a

-- | Convert a LogicT computation from one underlying monad to
--   another. For example,
--   
--   
--   hoistLogicT lift :: LogicT m a -> LogicT (StateT m) a
--   
--   
--   The first argument should be a monad morphism. to produce
--   sensible results.
hoistLogicT :: (Applicative m, Monad n) => (forall x. () => m x -> n x) -> LogicT m a -> LogicT n a

-- | Convert a LogicT computation from one underlying monad to
--   another.
--   
--   The first argument should be a monad morphism. to produce
--   sensible results.
embedLogicT :: forall m (n :: Type -> Type) b. Applicative m => (forall a. () => m a -> LogicT n a) -> LogicT m b -> LogicT n b
instance GHC.Internal.Base.Alternative (Control.Monad.Logic.LogicT f)
instance GHC.Internal.Base.Applicative (Control.Monad.Logic.LogicT f)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Control.Monad.Logic.Logic a)
instance GHC.Internal.Exception.Type.Exception Control.Monad.Logic.MyException
instance GHC.Internal.Data.Foldable.Foldable Control.Monad.Logic.Logic
instance (GHC.Internal.Base.Applicative m, GHC.Internal.Data.Foldable.Foldable m) => GHC.Internal.Data.Foldable.Foldable (Control.Monad.Logic.LogicT m)
instance GHC.Internal.Data.Foldable.Foldable m => GHC.Internal.Data.Foldable.Foldable (Control.Monad.Logic.ML m)
instance GHC.Internal.Data.Foldable.Foldable m => GHC.Internal.Data.Foldable.Foldable (Control.Monad.Logic.MLView m)
instance GHC.Internal.Base.Functor (Control.Monad.Logic.LogicT f)
instance GHC.Internal.Base.Functor m => GHC.Internal.Base.Functor (Control.Monad.Logic.ML m)
instance GHC.Internal.Base.Functor m => GHC.Internal.Base.Functor (Control.Monad.Logic.MLView m)
instance GHC.Internal.IsList.IsList (Control.Monad.Logic.Logic a)
instance Control.Monad.Catch.MonadCatch m => Control.Monad.Catch.MonadCatch (Control.Monad.Logic.LogicT m)
instance Control.Monad.Error.Class.MonadError e m => Control.Monad.Error.Class.MonadError e (Control.Monad.Logic.LogicT m)
instance GHC.Internal.Control.Monad.Fail.MonadFail (Control.Monad.Logic.LogicT m)
instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Control.Monad.Logic.LogicT m)
instance Control.Monad.Logic.Class.MonadLogic Control.Monad.Logic.Logic
instance GHC.Internal.Base.Monad m => Control.Monad.Logic.Class.MonadLogic (Control.Monad.Logic.LogicT m)
instance GHC.Internal.Base.Monad (Control.Monad.Logic.LogicT m)
instance GHC.Internal.Base.MonadPlus (Control.Monad.Logic.LogicT m)
instance Control.Monad.Reader.Class.MonadReader r m => Control.Monad.Reader.Class.MonadReader r (Control.Monad.Logic.LogicT m)
instance Control.Monad.State.Class.MonadState s m => Control.Monad.State.Class.MonadState s (Control.Monad.Logic.LogicT m)
instance Control.Monad.Catch.MonadThrow m => Control.Monad.Catch.MonadThrow (Control.Monad.Logic.LogicT m)
instance Control.Monad.Trans.Class.MonadTrans Control.Monad.Logic.LogicT
instance Control.Monad.Zip.MonadZip m => Control.Monad.Zip.MonadZip (Control.Monad.Logic.LogicT m)
instance GHC.Internal.Base.Monoid (Control.Monad.Logic.LogicT m a)
instance GHC.Classes.Ord a => GHC.Classes.Ord (Control.Monad.Logic.Logic a)
instance GHC.Internal.Read.Read a => GHC.Internal.Read.Read (Control.Monad.Logic.Logic a)
instance GHC.Internal.Base.Semigroup (Control.Monad.Logic.LogicT m a)
instance GHC.Internal.Show.Show a => GHC.Internal.Show.Show (Control.Monad.Logic.Logic a)
instance GHC.Internal.Show.Show Control.Monad.Logic.MyException
instance GHC.Internal.Data.Traversable.Traversable (Control.Monad.Logic.LogicT GHC.Internal.Data.Functor.Identity.Identity)
instance (GHC.Internal.Base.Monad m, GHC.Internal.Data.Traversable.Traversable m) => GHC.Internal.Data.Traversable.Traversable (Control.Monad.Logic.LogicT m)
instance GHC.Internal.Data.Traversable.Traversable m => GHC.Internal.Data.Traversable.Traversable (Control.Monad.Logic.ML m)
instance GHC.Internal.Data.Traversable.Traversable m => GHC.Internal.Data.Traversable.Traversable (Control.Monad.Logic.MLView m)
