[Haskell-cafe] manage effects in a DSL

Daniel Trstenjak daniel.trstenjak at gmail.com
Mon Feb 10 16:10:01 UTC 2014


Hi Dominique,

On Mon, Feb 10, 2014 at 04:55:52PM +0100, Dominique Devriese wrote:
> Hm. Interesting point, I guess this is the same problem as the whole
> orphan instances debate...  I didn't think of the connection to that
> problem.  Still, I'm convinced there are situations where local
> instances are *exactly* what we need, so there must be some way to
> avoid this problem...

If a type class has a clear semantical meaning, what should then
be the point of having multiple instances for the same data type?

A clear semantical meaning contradicts multiple instances, they would
only make reasoning about your code harder.

The few use cases where it might be nice to be able to define a new
instance aren't IMHO worth the drawbacks.

You would just open Haskell for Ruby like monkey patching.


Greetings,
Daniel


More information about the Haskell-Cafe mailing list