
Hi all, I am exploring OOHaskell and ran into some compilation issues with some of the samples. I hope this is the right place to report it. For example "OCamlTutorial.hs" generates the following error: ../samples/OCamlTutorial.hs:98:3: Multiple declarations of `foo' Declared at: ../samples/OCamlTutorial.hs:54:1 ../samples/OCamlTutorial.hs:98:3 Failed, modules loaded: OOHaskell, Dynamic, Print, DeepNarrow, Nominal, New. This is happening because the "label" macro on line 98: $(label "varX") doesn't expand correctly and clashes with the "foo" function on line 54: foo f = f # field1 The "label" function is found in the Data.HList.MakeLabels module and should work this way according to the docs:
runQ (label "test") >>= putStrLn . pprint data Test deriving (Data.Typeable.Internal.Typeable) test = Data.HList.FakePrelude.proxy :: Data.HList.FakePrelude.Proxy Test
But I get: data Foo_0 deriving (Data.Typeable.Internal.Typeable) foo_1 = Data.HList.FakePrelude.proxy :: Data.HList.FakePrelude.Proxy Foo_0 This still doesn't cleanly explain why "OCamlTutorial.hs" is failing since it seems to be generating unique datatypes and functions by suffixing them with a number, but it seems to point to the problem. I'm hoping someone who knows HList better might understand it better. Thanks, -deech

I believe this is the case of OOHaskell gotten a bit out of sync with HList and GHC. Please use the latest code bases http://code.haskell.org/HList http://code.haskell.org/OOHaskell OCamlTutorial and all other OOHaskell code should work (with GHC 7.0.4).

I just pulled the latest version of HList :
darcs clone http://code.haskell.org/HList
I compiled it with GHC 7.2.1 and I am still running into the same issue the "makeLabels" function:
runQ (makeLabels ["test1","test2"]) >>= putStrLn . pprint data Foo_0 deriving (Data.Typeable.Internal.Typeable) foo_1 = Data.HList.FakePrelude.proxy :: Data.HList.FakePrelude.Proxy Foo_0 data Foo_2 deriving (Data.Typeable.Internal.Typeable) foo_3 = Data.HList.FakePrelude.proxy :: Data.HList.FakePrelude.Proxy Foo_2
Also the cabal file that is currently at the tip of the repository includes
some of the files that have been moved into the "obsolete" directory. I
have attached an updated HList.cabal file that seems to work on my machine.
Thanks!
-deech
On Tue, Nov 8, 2011 at 8:16 PM,
I believe this is the case of OOHaskell gotten a bit out of sync with HList and GHC. Please use the latest code bases
http://code.haskell.org/HList http://code.haskell.org/OOHaskell
OCamlTutorial and all other OOHaskell code should work (with GHC 7.0.4).

I also have the same issue with OOHaskell after pulling from http://code.haskell.org/OOHaskell. After loading GHCI I did:
:l ../samples/OCamlTutorial.hs ../samples/OCamlTutorial.hs:97:3: Multiple declarations of `foo' Declared at: ../samples/OCamlTutorial.hs:53:1 ../samples/OCamlTutorial.hs:97:3 Failed, modules loaded: OOHaskell, Dynamic, Print, DeepNarrow, Nominal, New.
Also in the beginning I was unable to load lib/OOHaskell.hs into GHCI
because it tried to import a module that was no-longer exported by HList
"Data.HList.TypeEq0". When I commented out that line, it loaded fine into
GHCI.
-deech
On Fri, Nov 11, 2011 at 1:20 PM, aditya siram
I just pulled the latest version of HList :
darcs clone http://code.haskell.org/HList
I compiled it with GHC 7.2.1 and I am still running into the same issue the "makeLabels" function:
runQ (makeLabels ["test1","test2"]) >>= putStrLn . pprint
data Foo_0 deriving (Data.Typeable.Internal.Typeable) foo_1 = Data.HList.FakePrelude.proxy :: Data.HList.FakePrelude.Proxy Foo_0 data Foo_2 deriving (Data.Typeable.Internal.Typeable) foo_3 = Data.HList.FakePrelude.proxy :: Data.HList.FakePrelude.Proxy Foo_2
Also the cabal file that is currently at the tip of the repository includes some of the files that have been moved into the "obsolete" directory. I have attached an updated HList.cabal file that seems to work on my machine.
Thanks! -deech
On Tue, Nov 8, 2011 at 8:16 PM,
wrote: I believe this is the case of OOHaskell gotten a bit out of sync with HList and GHC. Please use the latest code bases
http://code.haskell.org/HList http://code.haskell.org/OOHaskell
OCamlTutorial and all other OOHaskell code should work (with GHC 7.0.4).

I have verified that the issue with the "makeLabels" function goes away if
I install 7.0.4. I got an extremely large error (~ 5000 lines) when loading
"OCamlTutorial.hs". When I've parsed through it, I'll post back. Sorry for
the confusion.
-deech
On Fri, Nov 11, 2011 at 1:33 PM, aditya siram
I also have the same issue with OOHaskell after pulling from http://code.haskell.org/OOHaskell. After loading GHCI I did:
:l ../samples/OCamlTutorial.hs ../samples/OCamlTutorial.hs:97:3: Multiple declarations of `foo' Declared at: ../samples/OCamlTutorial.hs:53:1 ../samples/OCamlTutorial.hs:97:3
Failed, modules loaded: OOHaskell, Dynamic, Print, DeepNarrow, Nominal, New.
Also in the beginning I was unable to load lib/OOHaskell.hs into GHCI because it tried to import a module that was no-longer exported by HList "Data.HList.TypeEq0". When I commented out that line, it loaded fine into GHCI.
-deech
On Fri, Nov 11, 2011 at 1:20 PM, aditya siram
wrote: I just pulled the latest version of HList :
darcs clone http://code.haskell.org/HList
I compiled it with GHC 7.2.1 and I am still running into the same issue the "makeLabels" function:
runQ (makeLabels ["test1","test2"]) >>= putStrLn . pprint
data Foo_0 deriving (Data.Typeable.Internal.Typeable) foo_1 = Data.HList.FakePrelude.proxy :: Data.HList.FakePrelude.Proxy Foo_0 data Foo_2 deriving (Data.Typeable.Internal.Typeable) foo_3 = Data.HList.FakePrelude.proxy :: Data.HList.FakePrelude.Proxy Foo_2
Also the cabal file that is currently at the tip of the repository includes some of the files that have been moved into the "obsolete" directory. I have attached an updated HList.cabal file that seems to work on my machine.
Thanks! -deech
On Tue, Nov 8, 2011 at 8:16 PM,
wrote: I believe this is the case of OOHaskell gotten a bit out of sync with HList and GHC. Please use the latest code bases
http://code.haskell.org/HList http://code.haskell.org/OOHaskell
OCamlTutorial and all other OOHaskell code should work (with GHC 7.0.4).

I have verified that the issue with the "makeLabels" function goes away if I install 7.0.4.
I'm glad to hear that. GHC 7.0.4 has updated Template Haskell in backward-incopatible ways.
I got an extremely large error (~ 5000 lines) when loading "OCamlTutorial.hs".
Quite likely the reason was the Data.HList.TypeEqO import that you have commented out. Data.HList.TypeEqO is really needed. I have pushed the changed HList.cabal. (I must admit I use HList without cabal-installing it: I simply arrange OOHaskell and HList as sibling subdirectories. See OOHaskell/samples/Makefile).

Thanks for updating the Cabal file. The reason I commented out the
Data.HList.TypeEqO was because I couldn't find it. I grepped the HList
source tree for it and I found references to it only in the following
places:
./Data/HList/RecordD.hs:import Data.HList.TypeEqO
./examples/TIPTransform.hs:import Data.HList.TypeEqO
./examples/MainGhcGeneric1.hs: module Data.HList.TypeEqO,
./examples/MainGhcGeneric1.hs:import Data.HList.TypeEqO
./examples/MainPatternMatch.hs:import Data.HList.TypeEqO
./examples/TIPTransformM.hs:import Data.HList.TypeEqO
./HList.cabal: Data.HList.HListPrelude,
Data.HList.TypeEqO,
I couldn't find it on Hoogle or Hayoo either. Am I missing something?
-deech
On Fri, Nov 11, 2011 at 10:25 PM,
I have verified that the issue with the "makeLabels" function goes away if I install 7.0.4.
I'm glad to hear that. GHC 7.0.4 has updated Template Haskell in backward-incopatible ways.
I got an extremely large error (~ 5000 lines) when loading "OCamlTutorial.hs".
Quite likely the reason was the Data.HList.TypeEqO import that you have commented out. Data.HList.TypeEqO is really needed. I have pushed the changed HList.cabal. (I must admit I use HList without cabal-installing it: I simply arrange OOHaskell and HList as sibling subdirectories. See OOHaskell/samples/Makefile).

The reason I commented out the Data.HList.TypeEqO was because I couldn't find it.
My apologies! It turns out I have forgotten to 'darcs add' it. It is committed now: http://code.haskell.org/HList/Data/HList/TypeEqO.hs

Awesome! The samples now work. Thanks so much for your help.
-deech
On Fri, Nov 11, 2011 at 11:14 PM,
The reason I commented out the Data.HList.TypeEqO was because I couldn't find it.
My apologies! It turns out I have forgotten to 'darcs add' it. It is committed now: http://code.haskell.org/HList/Data/HList/TypeEqO.hs
participants (2)
-
aditya siram
-
oleg@okmij.org