-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Simple, Fair and Terminating Backtracking Monad Transformer -- -- This Haskell library provides an implementation of the MonadPlus type -- class that enumerates results of a non-deterministic computation by -- interleaving subcomputations in a way that has usually much better -- memory performance than other strategies with the same termination -- properties. @package streamt @version 0.5.0.0 -- | This Haskell library provides an implementation of the MonadPlus type -- class that enumerates results of a non-deterministic computation by -- interleaving subcomputations in a way that has usually much better -- memory performance than other strategies with the same termination -- properties. -- -- By using supensions in strategic positions, the user can ensure that -- the search does not diverge if there are remaining non-deterministic -- results. -- -- More information is available on the author's website: -- http://okmij.org/ftp/Computation/monads.html#fair-bt-stream -- -- Warning: Stream is only a monad when the results of -- observeAll are interpreted as a multiset, i.e., a valid -- transformation according to the monad laws may change the order of the -- results. module Control.Monad.Stream -- | Results of non-deterministic computations of type StreamT m a -- can be enumerated efficiently. data StreamT m a type Stream = StreamT Identity -- | Suspensions can be used to ensure fairness. suspended :: Monad m => StreamT m a -> StreamT m a -- | The function runStream enumerates the results of a -- non-deterministic computation. -- | Deprecated: use observeAll runStream :: Stream a -> [a] observe :: Stream a -> a observeT :: MonadFail m => StreamT m a -> m a observeAll :: Stream a -> [a] observeAllT :: Monad m => StreamT m a -> m [a] observeMany :: Int -> Stream a -> [a] observeManyT :: Monad m => Int -> StreamT m a -> m [a] instance GHC.Base.Monad m => GHC.Base.Monad (Control.Monad.Stream.StreamT m) instance GHC.Base.Monad m => Control.Monad.Fail.MonadFail (Control.Monad.Stream.StreamT m) instance GHC.Base.Monad m => GHC.Base.Alternative (Control.Monad.Stream.StreamT m) instance GHC.Base.Monad m => GHC.Base.MonadPlus (Control.Monad.Stream.StreamT m) instance GHC.Base.Monad m => GHC.Base.Semigroup (Control.Monad.Stream.StreamT m a) instance GHC.Base.Monad m => GHC.Base.Monoid (Control.Monad.Stream.StreamT m a) instance GHC.Base.Monad m => GHC.Base.Functor (Control.Monad.Stream.StreamT m) instance GHC.Base.Monad m => GHC.Base.Applicative (Control.Monad.Stream.StreamT m) instance GHC.Base.Monad m => Control.Monad.Logic.Class.MonadLogic (Control.Monad.Stream.StreamT m) instance Control.Monad.Trans.Class.MonadTrans Control.Monad.Stream.StreamT instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Control.Monad.Stream.StreamT m) instance Control.Monad.Reader.Class.MonadReader r m => Control.Monad.Reader.Class.MonadReader r (Control.Monad.Stream.StreamT m) instance Control.Monad.State.Class.MonadState s m => Control.Monad.State.Class.MonadState s (Control.Monad.Stream.StreamT m) instance (GHC.Base.Monad m, Data.Foldable.Foldable m) => Data.Foldable.Foldable (Control.Monad.Stream.StreamT m) instance (GHC.Base.Monad m, Data.Traversable.Traversable m) => Data.Traversable.Traversable (Control.Monad.Stream.StreamT m)