[Haskell-cafe] Language extension proposal: aspects

Theodore Lief Gannon tanuki at gmail.com
Mon May 8 22:51:05 UTC 2017


On Mon, May 8, 2017 at 1:16 PM, MarLinn <monkleyon at gmail.com> wrote:

> On 2017-05-07 05:19, Theodore Lief Gannon wrote:
>
> To avoid surprises, they shouldn't propagate -- when foldMap invokes even,
> it sees the default Monoid instance for Bool (i.e. none).
>
> That sounds like a gateway to inconsistency. I think the solution is that
> adding an aspect to, say, an Int would not apply that aspects to all Int's,
> but only to the ones unifying with the annotated one.
>
Hmm... this might work? As long as you can handle the situation where a
higher-order function depends on one instance, but a function passed to it
depends on another. (Consider Maybe, which has at least four legal Monoid
instances, one of which is default!)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20170508/5def64df/attachment.html>


More information about the Haskell-Cafe mailing list