Re: [Haskell-cafe] records proposals list

Keean Schupke writes:
Haskell already has static records (in H98)
Dynamic records are addressed by the HList library, which uses extensions already present in GHC and Hugs (namely Multi-parameter type-classes and function-dependancies).
Is this the case? Every implementation of HList that I've seen also uses
overlapping and undecidable instances.
--
David Menendez

Am Dienstag, 22. November 2005 07:33 schrieb David Menendez:
Keean Schupke writes:
Haskell already has static records (in H98)
Dynamic records are addressed by the HList library, which uses extensions already present in GHC and Hugs (namely Multi-parameter type-classes and function-dependancies).
Is this the case? Every implementation of HList that I've seen also uses overlapping and undecidable instances.
The paper about HList I have seen does explicitely say that the authors were finally able to avoid using overlapping instances. I don't know about undecidable instances but I thought (and hope very much) that they don't need them too. Best wishes, Wolfgang

The HList code does not need overlapping-instances, however it does use undecidable instances. This is not however bad like overlapping instances is. Overlapping instances can break module independance (as in defining a new instance can change the meaning of an existing class in modules that are already compiled). Undecidable instances merely means the compiler is not capable of proving that the constraints terminate. In the case of an HList they "obviously" do (where the constraint recursion is structurally over the length of a list termination is obvious). This is more a weakness in the compiler rather than some problem with the HList code. Keean. Wolfgang Jeltsch wrote:
Am Dienstag, 22. November 2005 07:33 schrieb David Menendez:
Keean Schupke writes:
Haskell already has static records (in H98)
Dynamic records are addressed by the HList library, which uses extensions already present in GHC and Hugs (namely Multi-parameter type-classes and function-dependancies).
Is this the case? Every implementation of HList that I've seen also uses overlapping and undecidable instances.
The paper about HList I have seen does explicitely say that the authors were finally able to avoid using overlapping instances. I don't know about undecidable instances but I thought (and hope very much) that they don't need them too.
Best wishes, Wolfgang _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Just a follow up to my last post ... The HList paper also presents a way of removing overlapping instances from _any_ class. So infact support for overlapping instances is no longer required - and this removes all the messy problems with overlapping instances and functional dependancies. The current HList source distribution runs in hugs with "-98 +o" only because of "lazyness" on out part. All the occurances of overlapping instances can (will?) be removed from the source if it becomes an important issue (most of them are in auxilliary definitions that are not in the paper, like Show for HList. If you program in the "completely non overlapping instances" model, then compiler support for deriving TTypeable would be nice, or compiler support for a type level equality constraint (TypeEq could become a built-in). But just to make it clear - compiler support for this is not necessary, you just define instances of TTypeable for all your datatypes. There is a template-haskell library that can automatically derive TTypeable for any datatype as well. Keean. David Menendez wrote:
Keean Schupke writes:
Haskell already has static records (in H98)
Dynamic records are addressed by the HList library, which uses extensions already present in GHC and Hugs (namely Multi-parameter type-classes and function-dependancies).
Is this the case? Every implementation of HList that I've seen also uses overlapping and undecidable instances.
participants (3)
-
David Menendez
-
Keean Schupke
-
Wolfgang Jeltsch