@hackage / unlift

Typeclass for monads that can be unlifted to arbitrary base monads

Latest0.0.0.0

About

Metadata

  • Last updated , by vrom911
  • License MPL-2.0
  • Categories Monads
  • Maintained by: Kowainik <xrom.xkov@gmail.com>

  • Lottery factor: 0

Links

Installation

Tested Compilers

  1. 9.0.1
  2. 8.10.4
  3. 8.8.4

Readme

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.