| Portability | portable |
|---|---|
| Stability | experimental |
| Maintainer | Sebastian Fischer (sebf@informatik.uni-kiel.de) |
Control.Concurrent.ParallelTreeSearch
Description
This Haskell library provides an implementation of parallel search based on the search tree provided by the package tree-monad.
- class SearchQueue q where
- emptyQ :: q a
- addQ :: SearchTree a -> q a -> q a
- viewQ :: q a -> SearchView q a
- data SearchView q a
- = EmptyQ
- | (SearchTree a) :~ (q a)
- newtype LIFO a = LIFO [SearchTree a]
- newtype FIFO a = FIFO (Seq (SearchTree a))
- parallelTreeSearch :: SearchQueue q => Int -> Int -> q a -> IO [a]
Documentation
class SearchQueue q whereSource
Search queues store multiple search trees.
Methods
Constructs an empty search queue.
addQ :: SearchTree a -> q a -> q aSource
Adds a search tree to asearch queue.
viewQ :: q a -> SearchView q aSource
creates a view on a search queue for pattern matching.
Instances
data SearchView q a Source
A SearchView is used for pattern matching a search queue.
Constructors
| EmptyQ | |
| (SearchTree a) :~ (q a) |
LIFO search queues can be used to implement parallel depth-first search.
Constructors
| LIFO [SearchTree a] |
Instances
FIFO search queues can be used to implement parallel breadth-first search.
Constructors
| FIFO (Seq (SearchTree a)) |
Instances
Arguments
| :: SearchQueue q | |
| => Int | thread limit |
| -> Int | work limit |
| -> q a | queue with search trees |
| -> IO [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.