Safe Haskell | None |
---|---|
Language | Haskell98 |
- data Failing a :: * -> *
- failing :: ([String] -> b) -> (a -> b) -> Failing a -> b
- class Foldable c => SetLike c where
- slInsert :: (SetLike set, Ord a) => a -> set a -> set a
- prettyFoldable :: (Foldable t, Pretty a) => t a -> Doc
- setAny :: Foldable t => (a -> Bool) -> t a -> Bool
- setAll :: Foldable t => (a -> Bool) -> t a -> Bool
- flatten :: Ord a => Set (Set a) -> Set a
- tryfind :: Foldable t => (a -> Failing r) -> t a -> Failing r
- tryfindM :: Monad m => (t -> m (Failing a)) -> [t] -> m (Failing a)
- runRS :: RWS r () s a -> r -> s -> (a, s)
- evalRS :: RWS r () s a -> r -> s -> a
- settryfind :: (t -> Failing a) -> Set t -> Failing a
- (|=>) :: Ord k => k -> a -> Map k a
- (|->) :: Ord k => k -> a -> Map k a -> Map k a
- fpf :: Ord a => Map a b -> a -> Maybe b
- timeComputation :: IO r -> IO (r, NominalDiffTime)
- timeMessage :: (r -> NominalDiffTime -> String) -> IO r -> IO r
- time :: IO r -> IO r
- timeout :: String -> DiffTime -> IO r -> IO (Either String r)
- compete :: [IO a] -> IO a
- defined :: Ord t => Map t a -> t -> Bool
- undefine :: forall k a. Ord k => k -> Map k a -> Map k a
- apply :: Ord k => Map k a -> k -> Maybe a
- tryApplyD :: Ord k => Map k a -> k -> a -> a
- allpairs :: forall a b c set. (SetLike set, Ord c) => (a -> b -> c) -> set a -> set b -> set c
- distrib :: Ord a => Set (Set a) -> Set (Set a) -> Set (Set a)
- image :: (Ord b, Ord a) => (a -> b) -> Set a -> Set b
- optimize :: forall s a b. (SetLike s, Foldable s) => (b -> b -> Ordering) -> (a -> b) -> s a -> Maybe a
- minimize :: (Ord b, SetLike s, Foldable s) => (a -> b) -> s a -> Maybe a
- maximize :: (Ord b, SetLike s, Foldable s) => (a -> b) -> s a -> Maybe a
- can :: (t -> Failing a) -> t -> Bool
- allsets :: forall a b. (Num a, Eq a, Ord b) => a -> Set b -> Set (Set b)
- allsubsets :: forall a. Ord a => Set a -> Set (Set a)
- allnonemptysubsets :: forall a. Ord a => Set a -> Set (Set a)
- mapfilter :: (a -> Failing b) -> [a] -> [b]
- setmapfilter :: Ord b => (a -> Failing b) -> Set a -> Set b
- (∅) :: (Monoid (c a), SetLike c) => c a
- deepen :: (Depth -> Failing t) -> Depth -> Maybe Depth -> Failing (t, Depth)
- newtype Depth = Depth Int
- testLib :: Test
Documentation
data Failing a :: * -> *
An error idiom. Rather like the error monad, but collect all | errors together
Functor Failing | |
Applicative Failing | |
Alternative Failing | |
Show a => Show (Failing a) |
class Foldable c => SetLike c where Source
A simple class, slightly more powerful than Foldable, so we can write functions that operate on the elements of a set or a list.
prettyFoldable :: (Foldable t, Pretty a) => t a -> Doc Source
settryfind :: (t -> Failing a) -> Set t -> Failing a Source
Time and timeout
timeComputation :: IO r -> IO (r, NominalDiffTime) Source
Perform an IO operation and return the elapsed time along with the result.
timeMessage :: (r -> NominalDiffTime -> String) -> IO r -> IO r Source
Perform an IO operation and output a message about how long it took.
timeout :: String -> DiffTime -> IO r -> IO (Either String r) Source
Allow a computation to proceed for a given amount of time.
compete :: [IO a] -> IO a Source
Run several IO operations in parallel, return the result of the first one that completes and kill the others.
Map aliases
allpairs :: forall a b c set. (SetLike set, Ord c) => (a -> b -> c) -> set a -> set b -> set c Source
optimize :: forall s a b. (SetLike s, Foldable s) => (b -> b -> Ordering) -> (a -> b) -> s a -> Maybe a Source
deepen :: (Depth -> Failing t) -> Depth -> Maybe Depth -> Failing (t, Depth) Source
Try f with higher and higher values of n until it succeeds, or optional maximum depth limit is exceeded.