Modularised Prelude #41
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is not for merging just yet, as this formulation has some changes that will have impact elsewhere:
The following modules are currently defined in
purescript-control
but sans the actual classes. I've merged them in here, so I guess if we did this we'd want to remove them fromcontrol
? Either that or reverse the dependency andPrelude
would become something more like an even more minimalbase
.Data.Functor
Control.Apply
Control.Applicative
Control.Bind
Control.Monad
It seems like
Data.Functor
should belong in-functors
now we have it, but that's not a great option without some work and dependency shuffling - it depends ontuples
andfoldable-traversable
.Other breaking changes we talked about:
return
alias forpure
(++)
alias forappend
Some we didn't discuss, but seem worth considering:
liftM1
to justliftM
. I guess if we were going to include higher arity versions then keeping the 1 would make sense alternatively.lift2
...lift5
functions toliftAn
to make them less ambiguous and to matchliftA1
.when
andunless
intoControl.Applicative
and relaxed theMonad
constraint toApplicative
.Some non-breaking changes/enhancements:
Control
module exports itsControl
dependencies, so if you importApplicative
then you getFunctor
and associated operators in scope too.(X b) => X (a -> b)
as we had them on some classes and not others currentlyThere's a lot of stuff here, maybe we don't want any of it - that's fine, it was mainly to pass some time while on the road 😄