Closed imcotton closed 2 years ago
Code should generally follow the principle of least power for typeclass constraints. In this case however I don't think Pointed
is widely used in either Haskell or PureScript, and there's a minor discoverability benefit to limiting things to the "core" typeclasses.
I've never seen a use case for Pointed
specifically that didn't also call for Applicative
. Do you have a real world example?
Yeah, I know that Pointed
typeclass sits in a odd position in today's FP constructions, however for what it's worth, in current scope of fp-ts
it still plays the lifting
part.
I've never seen a use case for
Pointed
specifically that didn't also call forApplicative
. Do you have a real world example?
It occurred to me in the case of choose between when(Task.ApplicativePar)
and when(Task.ApplicativeSeq)
, then just realized it makes no difference after reading the implementation underneath:
To be clear, this is only a suggestion that might fit with current fp-ts
more economically, perhaps less correct in semantic terms.
You're right technically but for me it's a case of whether or not there's any real world use cases. I'm cognisant of how hard fp-ts' docs are to read largely on account of these countless intermediary typeclasses that in my experience aren't used much in practice, unlike for example applicatives.
I'm going to close this, but if some real world use cases for a Pointed
but not Applicative
abstraction pop up I'd be happy to revisit. In the meantime if anyone needs this you can safely redefine the relevant exports with an assertion as per the internals.
These two:
In case of
fp-ts
which hasPointed
type class to support theof
, seems unnecessary to requireApplicative
here, no?