Wednesday, January 14, 2009

Typeclass Blues

Well, I've been having some trouble with the typeclass implementation. I got rid of the long-standing bug where ill-typed rules were generated in E.FromHs, and I've gotten FrontEnd.Class to generate rules for method implementations which appear in instance declarations, but I haven't figured out how to implicitly fall back to the default implementation. The one approach I actually tried was to generate method implementations like:
Lhc.Order./= = Instance@.iLhc.Order./=.default
which would quickly be rewritten to:
Instance@.iLhc.Order./=.Lhc.IO.IOError = Instance@.iLhc.Order./=.default
but unfortunately, the typechecker stated that Instance@.iLhc.Order./=.default was not in the type-checking environment, and I couldn't figure out why :-(.

No comments:

Post a Comment