[Haskell-cafe] typeclass question
jonathanccast at fastmail.fm
Thu Sep 11 12:39:14 EDT 2008
On Thu, 2008-09-11 at 18:34 +0200, Johannes Waldmann wrote:
> >> if support for this simple shape of dependencies ( ... | a -> b ) ...
> > For backwards-compatibility reasons,
This gives point, then, to my concerns about letting Haskell become a
practical language. At some point, production systems always seem to be
end-of-lifed by backwards compatibility.
> > or because you think they're better than type families?
> Don't know (haven't used them).
> Concrete example: I have this "class Partial p i b | p i -> b"
> What would type families buy me here?
I can't figure out what b is. I could, of course, argue that it would
force you to come up with a name for `b', so people reading the code
could understand what it does.
> In my code, this class has tons of instances (I count 80).
> How much would I need to change them?
instance Partial p i b where
=> instance Partial p i
type B p i = b
And type signatures involving Partial would have to change.
> Could this be automated?
To a certain extent. Finding the places that need to change could be
automated, which is always the first step :)
More information about the Haskell-Cafe