Constraints on definition of `length` should be strengthened
Henning Thielemann
lemming at henning-thielemann.de
Mon Apr 3 16:38:52 UTC 2017
On Mon, 3 Apr 2017, David Feuer wrote:
> That leaves a few trouble spots:
>
> 1. There are types that some people think shouldn't have
> Functor/Foldable/Traversable instances at all, or that some people would
> like to have Functor and maybe even Traversable instances for without
> wanting Foldable instances. The latter is impossible because of a
> superclass constraint. One essential issue here seems to be one of
> perspective: is Foo x y a container of ys, decorated with xs, or is it a
> container of xs and ys? Different people tend to think about this
> differently, and thus form different intuitions.
I don't know if anyone has a problem with interpreting a custom data type
Foo x y as a container of ys decorated with xs - if it is defined for that
purpose. Discussion arose solely about the cases Foo = (,), Foo = (,,) x
and so on. E.g. I actually proposed to define a custom data type like
Decorated x y instead of (x,y) in case you want to have a Foldable
instance.
More information about the Libraries
mailing list