Popularity
8.0
Stable
Activity
0.0
Stable
2
16
9
Monthly Downloads: 19
Programming language: Haskell
License: MIT License
Tags:
Control
hoist-error alternatives and similar packages
Based on the "Control" category.
Alternatively, view hoist-error alternatives based on common mentions on social networks and blogs.
-
transient
A full stack, reactive architecture for general purpose programming. Algebraic and monadically composable primitives for concurrency, parallelism, event handling, transactions, multithreading, Web, and distributed computing with complete de-inversion of control (No callbacks, no blocking, pure state) -
selective
Selective Applicative Functors: Declare Your Effects Statically, Select Which to Execute Dynamically -
ComonadSheet
A library for expressing "spreadsheet-like" computations with absolute and relative references, using fixed-points of n-dimensional comonads. -
auto
Haskell DSL and platform providing denotational, compositional api for discrete-step, locally stateful, interactive programs, games & automations. http://hackage.haskell.org/package/auto -
transient-universe
A Cloud monad based on transient for the creation of Web and reactive distributed applications that are fully composable, where Web browsers are first class nodes in the cloud -
monad-validate
DISCONTINUED. (NOTE: REPOSITORY MOVED TO NEW OWNER: https://github.com/lexi-lambda/monad-validate) A Haskell monad transformer library for data validation -
distributed-process-platform
DEPRECATED (Cloud Haskell Platform) in favor of distributed-process-extras, distributed-process-async, distributed-process-client-server, distributed-process-registry, distributed-process-supervisor, distributed-process-task and distributed-process-execution -
ixmonad
Provides 'graded monads' and 'parameterised monads' to Haskell, enabling fine-grained reasoning about effects. -
effect-monad
Provides 'graded monads' and 'parameterised monads' to Haskell, enabling fine-grained reasoning about effects.
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
Promo
www.saashub.com
Do you think we are missing an alternative of hoist-error or a related project?
README
Hoist Error
A typeclass and some combinators to aid in the lifting of errors into your preferred context.
As an example, assuming we have the following error type:
data MyError
= WrongInt Int
| WrapLibError LibError
This package provides a combinator for straight forward translation of a general error case into a more specific type:
-- Given a function:
fn :: MonadIO m => Int -> m (Maybe b)
-- Working in some MonadError context..
... :: MonadError MyError m => m b
-- Handle the `Nothing` case by using an explicit constructor, with no intermediate boilerplate.
g :: (MonadIO m, MonadError MyError m) => Int -> m b
g n = fn n <!?> WrongInt n
You're able to run a function on the error as well:
-- Given...
fn :: MonadIO m => Int -> Either LibError b
-- Provide an `(e -> e')` function as required. In this case, wrapping a general
-- library error with our more relevant constructor.
g :: (MonadIO m, MonadError MyError m) => Int -> m b
g n = fn n <%!?> WrapLibError