-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Parallel Tree Search -- -- This Haskell library provides an implementation of parallel search -- based on the search tree provided by the package tree-monad. @package parallel-tree-search @version 0.2 -- | This Haskell library provides an implementation of parallel search -- based on the search tree provided by the package tree-monad. module Control.Concurrent.ParallelTreeSearch -- | Search queues store multiple search trees. class SearchQueue q emptyQ :: (SearchQueue q) => q a addQ :: (SearchQueue q) => SearchTree a -> q a -> q a viewQ :: (SearchQueue q) => q a -> SearchView q a -- | A SearchView is used for pattern matching a search queue. data SearchView q a EmptyQ :: SearchView q a (:~) :: SearchTree a -> q a -> SearchView q a -- | LIFO search queues can be used to implement parallel depth-first -- search. newtype LIFO a LIFO :: [SearchTree a] -> LIFO a -- | FIFO search queues can be used to implement parallel breadth-first -- search. newtype FIFO a FIFO :: (Seq (SearchTree a)) -> FIFO a -- | This function enumerates the results stored in the queue of -- SearchTrees in parallel. It is parameterised by the maximum -- number of threads to use and the maximum amount of work to perform by -- each thread before communicating the results. parallelTreeSearch :: (SearchQueue q) => Int -> Int -> q a -> IO [a] instance SearchQueue FIFO instance SearchQueue LIFO