do-notation-dsl: An alternative to monads

[ bsd3, control, deprecated, dsl, effect, general, io, language, library, mutable-state, polymorphism ] [ Propose Tags ]
Deprecated. in favor of control-dsl

Please see the README on GitHub at

[Skip to Readme]
Versions [faq],,, (info)
Change log
Dependencies base (>=4.8 && <5) [details]
License BSD-3-Clause
Copyright 2018 Yang Bo
Author Yang Bo
Category Control, DSL, Effect, General, Language, Mutable State, IO, Polymorphism
Home page
Bug tracker
Source repo head: git clone
Uploaded by yangbo at Tue Oct 2 14:41:38 UTC 2018
Distributions NixOS:
Downloads 242 total (63 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2018-10-02 [all 1 reports]


[Index] [Quick Jump]


Maintainer's Corner

For package maintainers and hackage trustees

Readme for do-notation-dsl-

[back to package description]


The Prelude.>>= combinator limits the return type as a m b, which cause Monads not composable. In order to ease this restrictions, this proposal introduces another type class Dsl for do notation.


Monads do not compose. Normally a do block cannot contains operators defined in different monad instances.

The state of art solution is using only one monad Eff, which forwards all monadic bind operations to custom effect handlers, instead of defining new monads.

However, the Eff approach is heavy weight than ordinary monad. It's not very convenient to create an additional indirect layer for simple use cases.

The Eff approach of bypassing >>= combinator is quite embarrassing. Since >>= settles on our logo, In this proposal we present a new approach to enable multiple operations at once by improving >>=. This proposal aims to port the approach used in Dsl.scala to Haskell. This approach improves the extensibility of >>=.