Deprecate Foldable for Either

Kris Nuttycombe kris.nuttycombe at gmail.com
Fri Mar 3 18:09:01 UTC 2017


On Fri, Mar 3, 2017 at 10:48 AM, Richard Eisenberg <rae at cs.brynmawr.edu>
wrote:

>
> On Mar 3, 2017, at 12:45 PM, Kris Nuttycombe <kris.nuttycombe at gmail.com>
> wrote:
>
> This is an interesting assertion; I don't believe that these goals work
> against one another at all. In fact, I find that (b) leads to "if it
> compiles, it works" much more often than not. John De Goes goes into depth
> on this principle here: http://degoes.net/articles/insufficiently-
> polymorphic where he points out "Monomorphic code is much more likely to
> be incorrect than polymorphic code, because for every type signature, there
> are many more possible implementations.".
>
>
> Ah -- very good point. This is true for the *implementation* of a
> polymorphic function, where a polymorphic type signature beautifully
> restricts what the function can do. But it is not true for monomorphic
> *uses* of a polymorphic function, where the generality can lead to an
> unexpected instance selection and thus runtime behavior.
>

I guess that, in the limit, this is why my code has been progressively
mutating to a style in which I only define data structures for the purpose
of being able to easily generate classy lenses/prisms into their
components/inhabitants. I now generally find concrete types more
restrictive and error-prone than I care for.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20170303/cd760628/attachment.html>


More information about the Libraries mailing list