| Safe Haskell | None | 
|---|---|
| Language | Haskell98 | 
Data.Search
- newtype Search a b = Search {
- optimum :: (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
 - newtype B = B Bool
 - 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.
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 #
Methods
epsilon :: Search a b Source #
epsilon :: (GHilbert a (Rep b), Generic b) => Search a b Source #
Instances
best :: Hilbert a b => (b -> a) -> b Source #
search for an optimal answer using Hilbert's epsilon
>>>best (>4) :: Int85
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 #
Boolean-valued search
Bool with a lazier Ord as suggested here