snoyberg / classy-prelude

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

forM_ and mapM_ and family require Monad, not Applicative #108

Open ghost opened 9 years ago

ghost commented 9 years ago

The functions forM_ and mapM_ (and other similar functions doing monadic folds) appearing in ClassyPrelude require that they be used for a Monad, when an Applicative would be enough. Is there a technical reason for this?

snoyberg commented 9 years ago

Yes: it would be a major breaking change on GHC 7.8, which we still support.

On Wed, Aug 12, 2015, 6:47 AM Sean Hunt notifications@github.com wrote:

The functions forM and mapM (and other similar functions doing monadic folds) appearing in ClassyPrelude require that they be used for a Monad, when an Applicative would be enough. Is there a technical reason for this?

— Reply to this email directly or view it on GitHub https://github.com/snoyberg/classy-prelude/issues/108.

gregwebs commented 9 years ago

We could export a version with an A suffix

ghost commented 9 years ago

It's not an inconvenience to me, I just noticed the inconsistency and had forgotten about the 7.8 thing.