monad-control: Lift control operations, like exception catching, through monad transformers

[ bsd3, control, library ] [ Propose Tags ]

This package defines the type class MonadBaseControl, a subset of MonadBase into which generic control operations such as catch can be lifted from IO or any other base monad. Instances are based on monad transformers in MonadTransControl, which includes all standard monad transformers in the transformers library except ContT.

See the lifted-base package which uses monad-control to lift IO operations from the base library (like catch or bracket) into any monad that is an instance of MonadBase or MonadBaseControl.

Note that this package is a rewrite of Anders Kaseorg's monad-peel library. The main difference is that this package provides CPS style operators and exploits the RankNTypes and TypeFamilies language extensions to simplify and speedup most definitions.

The following criterion based benchmark shows that monad-control is on average about 99% faster than monad-peel:

git clone https://github.com/basvandijk/bench-monad-peel-control

[Skip to Readme]

Modules

[Index]

Flags

Automatic Flags
NameDescriptionDefault
instancest

If enabled this package will export MonadBaseControl instances for the lazy and strict ST monad. If disabled these instances are only exported when base >= 4.4. If enabled it is required that the transformer-base package exports MonadBase instances for ST. It will do this by default.

Enabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1, 0.2, 0.2.0.1, 0.2.0.2, 0.2.0.3, 0.3, 0.3.0.1, 0.3.1, 0.3.1.1, 0.3.1.2, 0.3.1.3, 0.3.1.4, 0.3.2, 0.3.2.1, 0.3.2.2, 0.3.2.3, 0.3.3.0, 0.3.3.1, 1.0.0.0, 1.0.0.1, 1.0.0.2, 1.0.0.3, 1.0.0.4, 1.0.0.5, 1.0.1.0, 1.0.2.0, 1.0.2.1, 1.0.2.2, 1.0.2.3, 1.0.2.4, 1.0.3, 1.0.3.1
Change log NEWS
Dependencies base (>=3 && <4.7), base-unicode-symbols (>=0.1.1 && <0.3), transformers (>=0.2 && <0.4), transformers-base (>=0.4.1 && <0.5) [details]
License BSD-3-Clause
Copyright (c) 2011 Bas van Dijk, Anders Kaseorg
Author Bas van Dijk, Anders Kaseorg
Maintainer Bas van Dijk <v.dijk.bas@gmail.com>
Category Control
Home page https://github.com/basvandijk/monad-control
Bug tracker https://github.com/basvandijk/monad-control/issues
Source repo head: git clone git://github.com/basvandijk/monad-control.git
Uploaded by BasVanDijk at 2013-03-07T22:12:58Z
Distributions Arch:1.0.3.1, Debian:1.0.2.3, Fedora:1.0.3.1, FreeBSD:1.0.0.4, LTSHaskell:1.0.3.1, NixOS:1.0.3.1, Stackage:1.0.3.1, openSUSE:1.0.3.1
Reverse Dependencies 546 direct, 7822 indirect [details]
Downloads 310097 total (311 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for monad-control-0.3.2

[back to package description]

This package defines the type class MonadControlIO, a subset of MonadIO into which generic control operations such as catch can be lifted from IO. Instances are based on monad transformers in MonadTransControl, which includes all standard monad transformers in the transformers library except ContT.

Note that this package is a rewrite of Anders Kaseorg's monad-peel library. The main difference is that this package provides CPS style operators and exploits the RankNTypes language extension to simplify most definitions.

The package includes a copy of the monad-peel testsuite written by Anders Kaseorg The tests can be performed by using cabal test.

This critertion based benchmark shows that monad-control is on average about 2.5 times faster than monad-peel.