
27 Apr
2009
27 Apr
'09
5:15 p.m.
siki wrote:
I'm not sure if this is possible at all. I'd like to do something like this:
class A a where foo :: a -> Double
foo a = 5.0
class (A a) => B a where foo a = 7.0
This is currently not possible in Haskell. It's been proposed, though: http://haskell.org/haskellwiki/Class_system_extension_proposal If you have an actual example we might be able to come up with a different way of modelling it so that it does what you want, though. Martijn.