Re: Has anyone looked into adding subtyping to Haskell?

Polymorphic extensible records with subtyping are already expressible in Haskell. There is nothing needs to be added: http://homepages.cwi.nl/~ralf/HList/ http://homepages.cwi.nl/~ralf/OOHaskell/ The full code is available via darcs http://darcs.haskell.org/OOHaskell/ As to polymorphic variants, they too are implementable in Haskell right now. No new extensions are required. http://www.haskell.org/pipermail/haskell/2006-July/018172.html http://darcs.haskell.org/HList/src/VariantP.hs The code shows that the expression problem is solved in Haskell as it is.

On 5/31/07, oleg@pobox.com
Polymorphic extensible records with subtyping are already expressible in Haskell. There is nothing needs to be added:
http://homepages.cwi.nl/~ralf/HList/ http://homepages.cwi.nl/~ralf/OOHaskell/
The last time I tried this code, I reported to haskell-cafe that OOHaskell does not work when compiled as a library (at least under GHC). For some reason the code that uses OOHaskell had to be compiled along side it. Is this now fixed? If so, could it be available via hackage as a library for people to use? I can't tell if it's only meant as proof of concept or for actual use. But, your response makes me think it is intended for actual use if people would like to do that (hence my interest in getting the code into hackage). Thanks, Jason

The last time I tried this code, I reported to haskell-cafe that OOHaskell does not work when compiled as a library (at least under GHC). For some reason the code that uses OOHaskell had to be compiled along side it. Is this now fixed?
It may be, I have to try. It should be mentioned that most of the OOHaskell functionality (extensible polymorphic records and variants) are actually in HList. Einar Karttunen has ported the latter to GHC 6.6 and package under Cabal. I think the version is available on Hackage. Anyway, the curious behavior requiring the presence of OOHaskell sources seems like a problem with GHC separate compilation. Could that be distilled to a small example so that we can file a GHC problem report?

On 6/2/07, oleg@pobox.com
The last time I tried this code, I reported to haskell-cafe that OOHaskell does not work when compiled as a library (at least under GHC). For some reason the code that uses OOHaskell had to be compiled along side it. Is this now fixed?
It may be, I have to try. It should be mentioned that most of the OOHaskell functionality (extensible polymorphic records and variants) are actually in HList. Einar Karttunen has ported the latter to GHC 6.6 and package under Cabal. I think the version is available on Hackage. Anyway, the curious behavior requiring the presence of OOHaskell sources seems like a problem with GHC separate compilation. Could that be distilled to a small example so that we can file a GHC problem report?
The smallest example I was able to construct involved building HList and OOHaskell and installing them as modules. This was trivial in some sense, but I think it did require some modification (maybe the creation of a cabal file?). After that I simply tried to compile the examples provided using the libraries I had built. For some reason when I did this, the type checker rejected the examples. Building all the code together, as it's packaged worked fine. I have not tried recently. thanks, Jason
participants (2)
-
Jason Dagit
-
oleg@pobox.com