[Haskell-cafe] manage effects in a DSL
dominique.devriese at cs.kuleuven.be
Mon Feb 10 16:26:37 UTC 2014
2014-02-10 17:10 GMT+01:00 Daniel Trstenjak <daniel.trstenjak at gmail.com>:
> 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.
I disagree. Just think about the Ord type class. A decidable order
relation for a type is definitely something I would consider a clear
semantical meaning, but different sensible instances can be defined
for many types... The same thing goes for Eq or Monoid or MonadState
More information about the Haskell-Cafe