úÎ!617)      !"#$%&'( (c) Dan DoelBSD3dan.doel@gmail.com experimental+non-portable (multi-parameter type classes)Safe=?@ASX “logictMinimal implementation: msplitlogictfAttempts to split the computation, giving access to the first result. Satisfies the following laws: amsplit mzero == return Nothing msplit (return a `mplus` m) == return (Just (a, m))logict|Fair disjunction. It is possible for a logical computation to have an infinite number of potential results, for instance: 'odds = return 1 `mplus` liftM (2+) oddsESuch computations can cause problems in some circumstances. Consider: Cdo x <- odds `mplus` return 2 if even x then return x else mzero´Such a computation may never consider the 'return 2', and will therefore never terminate. By contrast, interleave ensures fair consideration of both branches of a disjunctionlogictgFair conjunction. Similarly to the previous function, consider the distributivity law for MonadPlus: /(mplus a b) >>= k = (a >>= k) `mplus` (b >>= k)«If 'a >>= k' can backtrack arbitrarily many tmes, (b >>= k) may never be considered. (>>-) takes similar care to consider both branches of a disjunctive computation.logictå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. 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)logict’Pruning. Selects one result out of many. Useful for when multiple results of a computation will be equivalent, or should be treated as such.logict3The inverse of msplit. Satisfies the following law: msplit m >>= reflect == mlogict Inverts a logic computation. If m$ succeeds with at least one value, lnot m fails. If m fails, then lnot m succeeds the value ().1 (c) Dan DoelBSD3dan.doel@gmail.com experimental+non-portable (multi-parameter type classes)Safe=?@ASX/ó logictZThe basic Logic monad, for performing backtracking computations returning values of type alogictYA monad transformer for performing backtracking computations layered over another monad mlogictHExtracts the first result from a LogicT computation, failing otherwise.logict/Extracts all results from a LogicT computation.logictCExtracts up to a given number of results from a LogicT computation.logictXRuns a LogicT computation with the specified initial success and failure continuations.logict+A smart constructor for Logic computations.logict3Extracts the first result from a Logic computation.logict.Extracts all results from a Logic computation.logictBExtracts up to a given number of results from a Logic computation.logictWRuns a Logic computation with the specified initial success and failure continuations.C)*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUV W      !"#$%&'()*+,-+./+.0+.1+.2+.3+.4+.5+.6+78+79+:;+:<+,=+,>+,?+,@+,A+,B+,C+,D+,E+,F+,G+,H+,I+,J+7K+LM+LN+LO+LP+QR+.S+.T+.U+.V+.W+.X+.Y+.Z+.[+.\+.]^_`^_ab%logict-0.6.0.3-6r6qduVxy9Y9NaLZHTJS6jControl.Monad.Logic.ClassControl.Monad.Logic MonadLogicmsplit interleave>>-ifteoncereflectlnot$fMonadLogicWriterT$fMonadLogicWriterT0$fMonadLogicStateT$fMonadLogicStateT0$fMonadLogicReaderT$fMonadLogic[]LogicLogicTunLogicTobserveT observeAllT observeManyT runLogicTlogicobserve observeAll observeManyrunLogic$fMonadErroreLogicT$fMonadStatesLogicT$fMonadReaderrLogicT$fTraversableLogicT$fFoldableLogicT$fMonadLogicLogicT$fMonadIOLogicT$fMonadTransLogicT$fMonadPlusLogicT$fMonadFailLogicT $fMonadLogicT$fAlternativeLogicT$fApplicativeLogicT$fFunctorLogicTbase Control.MonadguardGHC.BasejoinMonadfail>>=>>returnFunctorfmapData.TraversablemapMsequenceControl.Monad.IO.ClassMonadIOliftIOmfilter<$!>unless replicateM_ replicateMfoldM_foldM zipWithM_zipWithM mapAndUnzipMforever<=<>=>filterMforM Data.Foldablemsum sequence_forM_mapM_ Data.FunctorvoidapliftM5liftM4liftM3liftM2liftMwhen=<< MonadPlusmzeromplustransformers-0.5.5.0Control.Monad.Trans.Class MonadTranslift