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
Versions [RSS] 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.0.3 (info)
Change log ChangeLog.md
Dependencies base (>=4.8 && <5) [details]
License BSD-3-Clause
Copyright 2018 Yang Bo
Author Yang Bo
Maintainer pop.atry@gmail.com
Category Control, DSL, Effect, General, Language, Mutable State, IO, Polymorphism
Home page https://github.com/Atry/do-notation-dsl#readme
Bug tracker https://github.com/Atry/do-notation-dsl/issues
Source repo head: git clone https://github.com/Atry/do-notation-dsl
Uploaded by yangbo at 2018-10-02T14:41:38Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 2088 total (21 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2018-10-02 [all 1 reports]

Readme for do-notation-dsl-0.1.0.3

[back to package description]

Dsl

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.

Motivation

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 >>=.