Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
- class Searchable a where
- forsome :: Searchable a => (a -> Bool) -> Bool
- forevery :: Searchable a => (a -> Bool) -> Bool
- class (Searchable a, Countable a) => Finite a where
- allValues :: [a]
- assemble :: Applicative f => (a -> f b) -> f (a -> b)
- finiteSearch :: Finite a => (a -> Maybe b) -> Maybe b
- finiteCountPrevious :: Finite a => a -> Maybe a
- finiteCountMaybeNext :: Finite a => Maybe a -> Maybe a
Documentation
class Searchable a where Source
It turns out there are Searchable
instances that are not Finite
.
The (c -> s)
instance is based on the algorithm at
http://math.andrej.com/2007/09/28/seemingly-impossible-functional-programs/.
Searchable Bool | |
Searchable Int8 | |
Searchable Int16 | |
Searchable Int32 | |
Searchable Int64 | |
Searchable Word8 | |
Searchable Word16 | |
Searchable Word32 | |
Searchable Word64 | |
Searchable () | |
Searchable Nothing | |
Searchable a => Searchable (Maybe a) | |
(Countable c, Searchable s) => Searchable (c -> s) | |
(Searchable a, Searchable b) => Searchable (Either a b) | |
(Searchable a, Searchable b) => Searchable (a, b) |
forsome :: Searchable a => (a -> Bool) -> Bool Source
forevery :: Searchable a => (a -> Bool) -> Bool Source
class (Searchable a, Countable a) => Finite a where Source
Not necessarily in counting order.
assemble :: Applicative f => (a -> f b) -> f (a -> b) Source
finiteSearch :: Finite a => (a -> Maybe b) -> Maybe b Source
finiteCountPrevious :: Finite a => a -> Maybe a Source
finiteCountMaybeNext :: Finite a => Maybe a -> Maybe a Source