[Haskell-cafe] FGL instance constraint
Sebastian Fischer
sebf at informatik.uni-kiel.de
Sat May 1 03:51:44 EDT 2010
> Furthermore, as I said earlier,
> it doesn't make sense to constrain the label type just to make an
> instance of a type class.
>
> (Now, if we had other functions in there which _might_ depend on the
> label types, this _would_ make sense; as it stands however, it
> doesn't.)
>
> You'll notice that my empty does depend on a having a Cls instance
> because it will fail to compile. [...] I'm not understanding your
> point, and I suspect you're not understanding mine :)
Let's assume he did understand your point. I think Ivan doubt's that
there is any real need for the change because (while defining the set
monad may make sense) "it does not make sense" to wish for being able
to use additional constraints when defining the specific functions
that are currently in the Graph class.
I'm not sure if I agree. It would be interesting to see whether the
real graph behind the original problem is an example where such
additional constraints are really necessary and make sense.
Sebastian
--
Underestimating the novelty of the future is a time-honored tradition.
(D.G.)
More information about the Haskell-Cafe
mailing list