Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
A few utility functions with improved error reporting.
Synopsis
- tryRead :: (Read a, Show a, MonadFail m) => String -> m a
- lookup :: (OverloadedLookup t k v, Show k, Show t, MonadFail m, Applicative m) => k -> t -> m v
- lookupIn :: (OverloadedLookup t k v, Show k, MonadFail m, Applicative m) => Text -> k -> t -> m v
- class OverloadedLookup t k v | t -> k, t -> v where
- overloadedLookup :: k -> t -> Maybe v
Documentation
tryRead :: (Read a, Show a, MonadFail m) => String -> m a Source #
A read with better error messages.
lookup :: (OverloadedLookup t k v, Show k, Show t, MonadFail m, Applicative m) => k -> t -> m v Source #
Overloaded lookup with good error messages.
lookupIn :: (OverloadedLookup t k v, Show k, MonadFail m, Applicative m) => Text -> k -> t -> m v Source #
This is a version of lookup
for where there is no Show instance for the collection.
class OverloadedLookup t k v | t -> k, t -> v where Source #
overloadedLookup :: k -> t -> Maybe v Source #
Instances
Eq k => OverloadedLookup [(k, v)] k v Source # | |
Defined in Data.ErrorOr.Utils overloadedLookup :: k -> [(k, v)] -> Maybe v Source # | |
Ord k => OverloadedLookup (Map k v) k v Source # | |
Defined in Data.ErrorOr.Utils overloadedLookup :: k -> Map k v -> Maybe v Source # |