snoyberg / classy-prelude

A typeclass-based Prelude.
108 stars 15 forks source link

Add export for monad-loops #123

Closed TerrorJack closed 8 years ago

TerrorJack commented 8 years ago

I propose exporting monadic loop combinators from monad-loops package. The package is actively maintained and widely used, does not introduce extra dependencies, and the combinators are much more comprehensive than whenM and unlessM currently provided in classy-prelude.

nh2 commented 8 years ago

I've functions from this package a couple of times. While the functions can be very useful, the main downside is that it was written way before AMP. As a result, many functions are Monad when they could be Applicative and MonadPlus when they are Alternative. The love for lists is also too strong for my favour, at least in the destructing parts (like andM). That may not align too well with classy-prelude's idea of

encourage the use of appropriate data structures such as Vectors or HashMaps instead of always using lists and associated lists

I'd revise / make a modern version of it before including it in a prelude, I think.

TerrorJack commented 8 years ago

@nh2 You are right. Closing this pull request for now. Seems developing a monad-loops alternative suitable for post-AMP era is a good idea..or maybe we can implement them directly in classy-prelude?

snoyberg commented 8 years ago

I'd be in favor of adding them directly here. I also have no objection if you want to create a separate packages with those functions and import them.

On Wed, Mar 16, 2016, 6:41 AM Shao Cheng notifications@github.com wrote:

@nh2 https://github.com/nh2 You are right. Closing this pull request for now. Seems developing a monad-loops alternative suitable for post-AMP era is a good idea..or maybe we can implement them directly in classy-prelude?

— You are receiving this because you are subscribed to this thread.

Reply to this email directly or view it on GitHub https://github.com/snoyberg/classy-prelude/pull/123#issuecomment-197150846