Safe Haskell | None |
---|---|
Language | Haskell98 |
- newtype Search a b = Search {}
- pessimumM :: Monad m => Search (Down a) b -> (b -> m a) -> m b
- optimum :: Search a b -> (b -> a) -> b
- pessimum :: Search (Down a) b -> (b -> a) -> b
- optimalScore :: Search a b -> (b -> a) -> a
- pessimalScore :: Search (Down a) b -> (b -> a) -> a
- cps :: Search a b -> Cont a b
- union :: Ord a => Search a b -> Search a b -> Search a b
- pair :: Ord a => b -> b -> Search a b
- fromList :: Ord a => [b] -> Search a b
- class Hilbert a b where
- best :: Hilbert a b => (b -> a) -> b
- worst :: Hilbert (Down a) b => (b -> a) -> b
- bestScore :: Hilbert a b => (b -> a) -> a
- worstScore :: Hilbert (Down a) b => (b -> a) -> a
- every :: forall b. Hilbert B b => (b -> Bool) -> Bool
- exists :: forall b. Hilbert B b => (b -> Bool) -> Bool
Documentation
Given a test that is required to execute in finite time for _all_ inputs, even infinite ones,
Search
should productively yield an answer.
I currently also assume that comparison of scores can be done in finite time for all scores.
This rules out large score sets.
pessimumM :: Monad m => Search (Down a) b -> (b -> m a) -> m b Source #
Find the worst-scoring result of a search with monadic effects.
optimalScore :: Search a b -> (b -> a) -> a Source #
What is the best score obtained by the search?
pessimalScore :: Search (Down a) b -> (b -> a) -> a Source #
What is the worst score obtained by the search?
Hilbert's epsilon
class Hilbert a b where Source #
best :: Hilbert a b => (b -> a) -> b Source #
search for an optimal answer using Hilbert's epsilon
>>>
best (>4) :: Int8
5
worst :: Hilbert (Down a) b => (b -> a) -> b Source #
What is the worst scoring answer by Hilbert's epsilon?
worstScore :: Hilbert (Down a) b => (b -> a) -> a Source #