Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- 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
An error idiom. Rather like the error monad, but collect all | errors together
Instances
MonadFail Failing Source # | |
Defined in Data.Logic.ATP.Lib | |
Alternative Failing | |
Applicative Failing | |
Functor Failing | |
Monad Failing Source # | |
Data a => Data (Failing a) Source # | |
Defined in Data.Logic.ATP.Lib gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Failing a -> c (Failing a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Failing a) # toConstr :: Failing a -> Constr # dataTypeOf :: Failing a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Failing a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Failing a)) # gmapT :: (forall b. Data b => b -> b) -> Failing a -> Failing a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Failing a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Failing a -> r # gmapQ :: (forall d. Data d => d -> u) -> Failing a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Failing a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Failing a -> m (Failing a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Failing a -> m (Failing a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Failing a -> m (Failing a) # | |
Read a => Read (Failing a) Source # | |
Show a => Show (Failing a) | |
Eq a => Eq (Failing a) Source # | |
Ord a => Ord (Failing a) Source # | |
Defined in Data.Logic.ATP.Lib | |
Pretty a => Pretty (Failing a) Source # | |
Defined in Data.Logic.ATP.Lib pPrintPrec :: PrettyLevel -> Rational -> Failing a -> Doc # pPrintList :: PrettyLevel -> [Failing a] -> Doc # |
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.
slView :: forall a. c a -> Maybe (a, c a) Source #
slMap :: forall a b. Ord b => (a -> b) -> c a -> c b Source #
slUnion :: Ord a => c a -> c a -> c a Source #
slSingleton :: a -> c 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.
Orphan instances
MonadFail Failing Source # | |
Monad Failing Source # | |
Data a => Data (Failing a) Source # | |
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Failing a -> c (Failing a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Failing a) # toConstr :: Failing a -> Constr # dataTypeOf :: Failing a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Failing a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Failing a)) # gmapT :: (forall b. Data b => b -> b) -> Failing a -> Failing a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Failing a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Failing a -> r # gmapQ :: (forall d. Data d => d -> u) -> Failing a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Failing a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Failing a -> m (Failing a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Failing a -> m (Failing a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Failing a -> m (Failing a) # | |
Read a => Read (Failing a) Source # | |
Eq a => Eq (Failing a) Source # | |
Ord a => Ord (Failing a) Source # | |
Pretty a => Pretty (Failing a) Source # | |
pPrintPrec :: PrettyLevel -> Rational -> Failing a -> Doc # pPrintList :: PrettyLevel -> [Failing a] -> Doc # |