Closed milessabin closed 9 years ago
I was thinking about this.
One the one hand I like the consistency. Maybe the type class itself should even be called Pure
?
On the other, pure
in the context of Applicative
is defined in terms of a particular relationship with ap
and map
. I'm reluctant to claim that Pointed#point
has that meaning. In this sense we could say:
Point is the same as pure if-and-only-if there are corresonding map and ap methods.
What do you think? I'm open to being convinced either way.
I also wondered about renaming the whole thing to Pure
... that doesn't seem quite so important though.
I guess my main concern is wanting to be able to implement both Applicative
and Pointed
/Pure
with a single pure
method rather than having to provide both.
Ah, I see. OK, I think that is an overriding concern.
One thing we might want to mandate for these ad-hoc type classes (e.g. Empty
, EmptyK
, Pure
) is that when a corresponding strong type class exists (e.g. Monoid
, MonoidK
, Applicative
) that the instances are required to be congruent.
Yes, strongly agree. I think we should require a strongIsWeak
implicit as you've done (ie. applicativeIsPointed
, comonadIsCopointed
, etc.) ... would that be enough assurance of congruence?
FTR I would be fine with s/Pointed/Pure/ and s/Copointed/Extract/.
Fixed in 9061c5ecf0f2d3b7402.
Shouldn't this method align with
pure
inApplicative
?