-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Simple, Fair and Terminating Backtracking Monad
--
-- 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 stream-monad
@version 0.2
-- | 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 authors website:
-- http://okmij.org/ftp/Computation/monads.html#fair-bt-stream
--
-- Warning: Stream is only a monad when the results of
-- runStream 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 Stream a
-- can be enumerated efficiently.
data Stream a
-- | Suspensions can be used to ensure fairness.
suspended :: Stream a -> Stream a
-- | The function runStream enumerates the results of a
-- non-deterministic computation.
runStream :: Stream a -> [a]
instance MonadTimes Stream
instance MonadPlus Stream
instance Monad Stream
instance Functor Stream