-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Non-Determinism Monad for Level-Wise Search
--
-- This Haskell library provides an implementation of the MonadPlus type
-- class that enumerates the levels of the search space using
-- breadth-first search or iterativ deepening.
@package level-monad
@version 0.3
-- | This library provides an implementation of the MonadPlus type class
-- that enumerates the levels of the search space and allows to implement
-- breadth-first search.
--
-- The implementation is inspired by Mike Spivey and Silvija Seres: cf.
-- Chapter 9 of the book 'The Fun of Programming'.
--
-- Warning: Levels is only a monad when the results of the
-- enumeration functions 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.Levels
-- | Non-Deterministic computations of type Levels a can be
-- searched level-wise.
data Levels a
-- | The function levels yields the results of a non-deterministic
-- computation grouped in levels.
levels :: Levels a -> [[a]]
-- | The function breadthFirstSearch enumerates the results of a
-- non-deterministic computation in breadth-first order.
breadthFirstSearch :: Levels a -> [a]
-- | The type DepthBound represents computations with a bounded
-- depth. It's monad instances implements iterative deepening.
data DepthBound a
-- | The function iterLevels computes the levels of a depth bound
-- computation using iterative deepening.
iterLevels :: DepthBound a -> Levels a
-- | The function iterativeDeepening enumerates the results of a
-- non-deterministic computations using iterative deepening.
iterativeDeepening :: DepthBound a -> [a]
-- | The function diagonals enumarates the entries of a matrix
-- diagonally. The matrix may contain an infinite number of infinite
-- rows.
diagonals :: [[a]] -> [[a]]
instance MonadPlus DepthBound
instance Monad DepthBound
instance MonadPlus Levels
instance Monad Levels