Control.Monad proposal: Add whenJust
Bas van Dijk
v.dijk.bas at gmail.com
Wed May 15 22:40:45 CEST 2013
On 15 May 2013 18:14, Edward Kmett <ekmett at gmail.com> wrote:
> Personally, I'd be all for just moving Foldable (and Traversable) into the
> Prelude and retiring the monomorphic versions of the functions they supply.
What would be the best way to do this?
1) Immediately remove all monomorphic versions and export the Foldable
and Traversable versions instead. I can imagine this can introduce
type ambiguity errors.
2) First deprecate the monomorphic versions in favor of the versions
from Data.Foldable and Data.Traversable. This gives users a warning
that they need to update their code. But to get rid of the warning
they have to import from Data.Foldable or Data.Traversable (the have
to use qualified imports or hide the deprecated functions from the
Prelude). Then in a later version of base the monomorphic versions are
removed and the Foldable and Traversable versions are exported
instead. At this point the users may want to update their code again
to just import the functions from the Prelude to reduce the number of
3) Some process I have not thought about yet...
Currently, I would favor 1 since I expect the breakage to be minimal.
More information about the Libraries