monad-io-adapter: Adapters between MonadIO and MonadBase IO.

[ control, library ] [ Propose Tags ] [ Report a vulnerability ]

This package provides utilities for converting between computations parameterized via two different typeclasses MonadIO and MonadBase, both of which can be used to abstract over monad transformer stacks with IO at the base. Unfortunately, both classes are frequently used in the Haskell ecosystem, since they have minor differences.

Due to these typeclasses being unrelated, it’s not entirely uncommon to end up with type signatures like (MonadIO m, MonadBaseControl IO m) => ..., which are a little silly, since MonadBaseControl IO really includes all the power of MonadIO.

To help alleviate this problem, this package provides a set of utilities for converting between the two constraints in situations where possible.


[Skip to Readme]

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0
Change log CHANGELOG.md
Dependencies base (>=4.9 && <5), exceptions (>=0.6 && <1), monad-control (>=1 && <2), monad-logger, mtl, transformers, transformers-base [details]
License ISC
Copyright 2017 CJ Affiliate by Conversant
Author Alexis King <lexi.lambda@gmail.com>
Maintainer Alexis King <lexi.lambda@gmail.com>
Category Control
Home page https://github.com/cjdev/monad-io-adapter#readme
Bug tracker https://github.com/cjdev/monad-io-adapter/issues
Source repo head: git clone https://github.com/cjdev/monad-io-adapter
Uploaded by lexi_lambda at 2017-11-21T17:11:41Z
Distributions NixOS:0.1.0.0
Reverse Dependencies 1 direct, 2 indirect [details]
Downloads 1065 total (8 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-11-21 [all 1 reports]

Readme for monad-io-adapter-0.1.0.0

[back to package description]

monad-io-adapter Build Status

This Haskell package provides utilities for converting between computations parameterized via two different typeclasses, both of which can be used to abstract over monad transformer stacks with IO at the base. Unfortunately, both classes are frequently used in the Haskell ecosystem, since they have minor differences:

  • MonadIO comes from the base package (as of base version 4.9.0.0), and it provides a liftIO operation. It is an extremely simple typeclass, focusing exclusively on lifting IO actions through transformer stacks with IO at the base.

  • MonadBase comes from the transformers-base package, and it is a generalized version of MonadIO. It provides a more general liftBase function, which allows lifting to an arbitrary base monad.

    Generally, this additional power isn’t especially useful, but MonadBase appears most often through MonadBaseControl, a subclass from the monad-control package that enables lifting operations that accept an action in negative position. This class has no IO-specialized equivalent (not directly, at least), so it often appears in lifted “control” operations.

Due to these typeclasses being unrelated, it’s not entirely uncommon to end up with type signatures like (MonadIO m, MonadBaseControl IO m) => ..., which are a little silly, since MonadBaseControl IO really includes all the power of MonadIO.

For more information, see the documentation on Hackage.