úÎ4/µ     +non-portable (multi-parameter type classes) experimentaldan.doel@gmail.com Safe-InferredMinimal implementation: msplit >Attempts to split the computation, giving access to the first ) result. Satisfies the following laws: / msplit mzero == return Nothing 5 msplit (return a `mplus` m) == return (Just (a, m)) ;Fair disjunction. It is possible for a logical computation B to have an infinite number of potential results, for instance:  ) odds = return 1 `mplus` liftM (2+) odds FSuch computations can cause problems in some circumstances. Consider:   do x <- odds `mplus` return 2 ' if even x then return x else mzero *Such a computation may never consider the 'return 2' , and will C therefore never terminate. By contrast, interleave ensures fair 3 consideration of both branches of a disjunction ?Fair conjunction. Similarly to the previous function, consider ) the distributivity law for MonadPlus:  1 (mplus a b) >>= k = (a >>= k) `mplus` (b >>= k) If 'a >>= k': can backtrack arbitrarily many tmes, (b >>= k) may never H be considered. (>>-) takes similar care to consider both branches of  a disjunctive computation. -Logical conditional. The equivalent of Prolog's soft-cut. If its E first argument succeeds at all, then the results will be fed into ? the success branch. Otherwise, the failure branch is taken. ! satisfies the following laws: ) ifte (return a) th el == th a ' ifte mzero th el == el < ifte (return a `mplus` m) th el == th a `mplus` (m >>= th) BPruning. Selects one result out of many. Useful for when multiple H results of a computation will be equivalent, or should be treated as  such. 4The inverse of msplit. Satisfies the following law:  msplit m >>= reflect == m  Inverts a logic computation. If m# succeeds with at least one value,  lnot m fails. If m fails, then lnot m succeeds the value ().  +non-portable (multi-parameter type classes) experimentaldan.doel@gmail.com Safe-Inferred @The basic Logic monad, for performing backtracking computations  returning values of type a =A monad transformer for performing backtracking computations  layered over another monad m 5Extracts the first result from a LogicT computation,  failing otherwise. 0Extracts all results from a LogicT computation. DExtracts up to a given number of results from a LogicT computation. ARuns a LogicT computation with the specified initial success and  failure continuations. ,A smart constructor for Logic computations. 4Extracts the first result from a Logic computation. /Extracts all results from a Logic computation. CExtracts up to a given number of results from a Logic computation. @Runs a Logic computation with the specified initial success and  failure continuations.   !"#$%&'B()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRST        !"#$%&'U       !"#$%&'()*+,*+-*+.*+/*+0*12*13*+4*+5*16*17*18*19*1:*1;*1<*1=*1>*1?*1@*1A*1B*1C*1D*1E*1F*1G*1H*1I*1J*1K*1L*1M*1N*1O*1P*1Q*1R*1S*1T*1UVWXVWYVZ[VZ\]logict-0.6.0.1Control.Monad.Logic.ClassControl.Monad.Logic MonadLogicmsplit interleave>>-ifteoncereflectlnotLogicLogicTunLogicTobserveT observeAllT observeManyT runLogicTlogicobserve observeAll observeManyrunLogic$fMonadLogicWriterT$fMonadLogicWriterT0$fMonadLogicStateT$fMonadLogicStateT0$fMonadLogicReaderT$fMonadLogic[]$fMonadErroreLogicT$fMonadStatesLogicT$fMonadReaderrLogicT$fTraversableLogicT$fFoldableLogicT$fMonadLogicLogicT$fMonadIOLogicT$fMonadTransLogicT$fMonadPlusLogicT $fMonadLogicT$fAlternativeLogicT$fApplicativeLogicT$fFunctorLogicTbaseGHC.Basefail>>=>>fmapreturn Control.MonadguardliftMMonadFunctor MonadPlusmfilterapliftM5liftM4liftM3liftM2unlesswhen replicateM_ replicateMfoldM_foldM zipWithM_zipWithM mapAndUnzipMjoinvoidforever<=<>=>msumforM_forMfilterMmapM_mapM sequence_sequence=<<mplusmzerotransformers-0.3.0.0Control.Monad.Trans.Classlift MonadTransControl.Monad.IO.ClassliftIOMonadIO