Closed pkamenarsky closed 8 years ago
Dropping the constraint seems reasonable to me. Anyone know if it's required for some other reason? @paf31 / @zrho?
With at
there is a canonical implementation of ix
: ix i = at i <<< _Maybe
. While the constraint isn't strictly necessary, I would find it
surprising to encounter an instance of At
that doesn't implement Index
.
What's your motivation for removing the constraint?
On 15 Feb 2016 4:35 pm, "Gary Burgess" notifications@github.com wrote:
Dropping the constraint seems reasonable to me. Anyone know if it's required for some other reason? @paf31 https://github.com/paf31 / @zrho https://github.com/zrho?
— Reply to this email directly or view it on GitHub https://github.com/purescript-contrib/purescript-profunctor-lenses/issues/23#issuecomment-184256502 .
_Just
of course, instead of maybe.
On 15 Feb 2016 5:26 pm, "Lukas Heidemann" lukasheidemann@gmail.com wrote:
With
at
there is a canonical implementation ofix
:ix i = at i <<< _Maybe
. While the constraint isn't strictly necessary, I would find it surprising to encounter an instance ofAt
that doesn't implementIndex
. What's your motivation for removing the constraint? On 15 Feb 2016 4:35 pm, "Gary Burgess" notifications@github.com wrote:Dropping the constraint seems reasonable to me. Anyone know if it's required for some other reason? @paf31 https://github.com/paf31 / @zrho https://github.com/zrho?
— Reply to this email directly or view it on GitHub https://github.com/purescript-contrib/purescript-profunctor-lenses/issues/23#issuecomment-184256502 .
It seems to me that in order to implement an Index
instance, one has to use wander
from the internal module Data.Lens.Internal.Wander
. Is this the case?
That might well be the case. Although Wander
is "Internal" it's not internal in the sense that it's supposed to be private to purescript-profunctor-lenses
, it's just that it probably doesn't have much use outside of a lens context. It's totally fine to define things in terms of wander
.
Oh ok, then I'm fine with defining an Index
instance in order to fulfil the At
constraints.
I have no idea about the theoretical foundations, but is the
Index
constraint on allAt
instances really necessary? It isn't used anywhere in theAt
instances inprofunctor-lenses
at least.