You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
There should be level-polymorphic versions of the combinators in Data.List.Categorical #951
The definitions of RawFunctor, RawApplicative, &c, by necessity, make it so that their fields (like _<$>_) only work on functions between types at the same level. This means, for example, that the _⊛_ we get from applicative in Data.List.Categorical has type ∀ {ℓ} {A B : Set ℓ} → List (A → B) → List A → List B. However, it would be convenient to have a definition of _⊛_ somewhere with type ∀ {a b} {A : Set a} {B : Set b} → List (A → B) → List A → List B.
Probably these definitions should go in Data.List.Base, though this would probably break any code using the categorical combinators because of name clashes.
There are probably similar problems in all of the other Categorical modules, but I haven't had a look at them yet.
Another funny thing is that RawMonad is not a subclass of RawApplicative, so the _⊛_ coming from monad is different to the one coming from applicative. When I tried just using the definition from applicative, it broke some proofs.
It's easy enough to hand-code something, but that feels like cheating (and non-scalable). I do have a more level-polymorphic RawFunctor, but RawApplicative has resisted all my attempts at generalization.
Activity
gallais commentedon Oct 18, 2019
Yep. See for instance the level polymorphic
_>>=_inData.Maybe.Base.laMudri commentedon Oct 18, 2019
Another funny thing is that
RawMonadis not a subclass ofRawApplicative, so the_⊛_coming frommonadis different to the one coming fromapplicative. When I tried just using the definition fromapplicative, it broke some proofs.gallais commentedon Oct 18, 2019
I'd argue that is a bug that we should definitely fix in version 2.0.
MatthewDaggitt commentedon Oct 19, 2019
@laMudri maybe open a new issue for it?
laMudri commentedon Oct 19, 2019
#952
MatthewDaggitt commentedon Oct 29, 2019
If people are keen to include this in
v1.2as the milestone suggests, could someone open a PR in the next couple of days?JacquesCarette commentedon Oct 29, 2019
It's easy enough to hand-code something, but that feels like cheating (and non-scalable). I do have a more level-polymorphic
RawFunctor, butRawApplicativehas resisted all my attempts at generalization.MatthewDaggitt commentedon Sep 12, 2022
Harder than first thought. According to @JacquesCarette needs some level-function hackery. Bumping.