unlift: Typeclass for monads that can be unlifted to arbitrary base monads

[ control, library, monad, mpl, typeclass, unlift ] [ Propose Tags ] [ Report a vulnerability ]

Typeclass for monads that can be unlifted to arbitrary base monads. See README.md for more details.


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.0.0.0
Change log CHANGELOG.md
Dependencies base (>=4.13.0.0 && <4.16), stm (>=2.5 && <2.6), transformers (>=0.5 && <0.6), transformers-base (>=0.4.5 && <0.5) [details]
Tested with ghc ==8.8.4, ghc ==8.10.4, ghc ==9.0.1
License MPL-2.0
Copyright 2021 Kowainik
Author Veronika Romashkina, Dmitrii Kovanikov
Maintainer Kowainik <xrom.xkov@gmail.com>
Category Typeclass, Monad, Unlift, Control
Home page https://github.com/kowainik/unlift
Bug tracker https://github.com/kowainik/unlift/issues
Source repo head: git clone https://github.com/kowainik/unlift.git
Uploaded by vrom911 at 2021-04-21T05:14:02Z
Distributions
Downloads 276 total (7 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for unlift-0.0.0.0

[back to package description]

unlift

GitHub CI Hackage MPL-2.0 license

Typeclass for monads that can be unlifted to arbitrary base monads:

class (MonadBase b m) => MonadUnlift b m
  where
    withRunInBase :: ((forall a . m a -> b a) -> b x) -> m x

This typeclass is helpful when writing code that is polymorphic over the base monad, so later you can select a different base monad for each specific use-case.

Common usages include:

  1. Concurrent testing with dejafu.
  2. Working with code over polymorphic PrimMonad.