
25 Jan
2013
25 Jan
'13
3:39 p.m.
This has the code smell of trying to use typeclasses for OOP. That won't work. (Yes, really.)
I am not trying to use OOP, I am just writing some typecasting at all.
This would be correct. Constraints on an instance are applied *after* the instance is selected, so when Haskell is looking for an instance, these two are identical.
I didn't understand why these two instances are identical ? The constraints are different and OverlappingInstances should permit overlapping typeclasses in constraints and select more specific instance clause.