Closed mitchellwrosen closed 8 years ago
An attempt at avoiding overlapping instances by ensuring they are all always concrete. Not sure it's a great idea or not though - I suspect GHC's instance checker could cope just fine.
Ah, I see! There are also these:
(Data a, Data b, Uniplate b) => Biplate a b
(Typeable a, Typeable b, Uniplate b, PlateAll a b) => Biplate a b
I think I was hitting something like no instance for Biplate (NonEmpty Foo) Foo
and opened this ticket. Turns out I just needed to derive Data
or Typeable
Whoops, reopening this for a second. Now that NonEmpty
is in base, would you accept a patch for this instance?
(PlateAll from to, Typeable from, Typeable to, Uniplate to) => PlateAll (NonEmpty from) to
I certainly would, provided it had the CPP magic to not trigger on older versions. However, are you really using the Typeable
variants of Uniplate? My experience is that sometimes they are slower than the Data
variants, and always require more code. I'd actually been considering deleting them.
I was using the Typeable
variants, yeah, because I had a function inside the data structure and there's no Data
instance for a -> b
. However, I realized the PlateAll
instance for NonEmpty
was not really needed, as I could wrangle something together with Str
.
If you want to remove the Typeable
variants to clean up the API, by all means!
This is resolved from my end, so closing
Hi, I'm curious why there's no
Biplate [a] a
instance defined in the library, just aBiplate [Char] Char
one.Thanks!