[Haskell-cafe] How can I get rid of this link error?
I wrote a library called AmysGeometry. The only modules in it (so far) are: Amy/Geometry/ThreeD.hs Amy/Geometry/UnitSphere.hs The library compiles just fine, and I've been using it with other programs for a while. Then yesterday, I started getting the following error. Linking dist/build/add-centroids/add-centroids ... /usr/local/lib/AmysGeometry-1.0/ghc-7.0.3/libHSAmysGeometry-1.0.a(UnitSphere.o): In function `s3c6_info': (.text+0x4557): undefined reference to `__stginit_AmysGeometryzm1zi0_AmyziGeometry_' /usr/local/lib/AmysGeometry-1.0/ghc-7.0.3/libHSAmysGeometry-1.0.a(UnitSphere.o): (.data+0x3f0): undefined reference to `AmysGeometryzm1zi0_AmyziGeometry_DZCLocation_static_info' collect2: ld returned 1 exit status cabal: Error: some packages failed to install: I think this started because I recompiled some stuff with profiling. So I wiped out my current GHC and Haskell installation, re-installed it, and rebuilt AmysGeometry. But I'm still getting this error when I try to link with it. I would be grateful for any advice on how to diagnose this and fix it. Oh, and ghc-pkg check doesn't report any errors. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] How can I get rid of this link error?
have you tried cabal clean before cabal install ? Tom On Fri, Nov 11, 2011 at 12:06 PM, Amy de Buitléir a...@nualeargais.ie wrote: I wrote a library called AmysGeometry. The only modules in it (so far) are: Amy/Geometry/ThreeD.hs Amy/Geometry/UnitSphere.hs The library compiles just fine, and I've been using it with other programs for a while. Then yesterday, I started getting the following error. Linking dist/build/add-centroids/add-centroids ... /usr/local/lib/AmysGeometry-1.0/ghc-7.0.3/libHSAmysGeometry-1.0.a(UnitSphere.o): In function `s3c6_info': (.text+0x4557): undefined reference to `__stginit_AmysGeometryzm1zi0_AmyziGeometry_' /usr/local/lib/AmysGeometry-1.0/ghc-7.0.3/libHSAmysGeometry-1.0.a(UnitSphere.o): (.data+0x3f0): undefined reference to `AmysGeometryzm1zi0_AmyziGeometry_DZCLocation_static_info' collect2: ld returned 1 exit status cabal: Error: some packages failed to install: I think this started because I recompiled some stuff with profiling. So I wiped out my current GHC and Haskell installation, re-installed it, and rebuilt AmysGeometry. But I'm still getting this error when I try to link with it. I would be grateful for any advice on how to diagnose this and fix it. Oh, and ghc-pkg check doesn't report any errors. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Consuming anyToken with parsing with derivatives (derp) library in Hackage?
I was playing with derp recently, and many of the Char and Combinator of Parsec seem to be easily definable from derp. However, I haven't yet figured out a natural way to define anyToken or satisfy combiator of Parsec using derp. There is a way of course, to list all the unicode characters and combine them with |, which is extremely inefficient, even if you limit yourself that satisfy combinator be compile time template haskell function, it still seems a bit silly. For things like space, it seems reasonable to list all take the sum of them, since there are handful of them. But things like consume anything that is not a space ought to be defined as a complement or negation of the space parser. In general CFG is not closed under negation, but most of the time what we want to take a negation is really for regular fragment of the language, like consuming anything that is not a linebreak to lex/parse one line comments. In Matt's Standford talk, he mentioned some vision about going beyond CFG and he mentioned negation, but in the library implementation I didn't find that. Is it already possible with some trick? Is there a standard way to define such combinators with derp? Or, is it the case that there a way to do it in the scheme library but not implemented in Haskell derp package? I read through the scheme implementation too but there didn't seem to be a combinator for tacking negations either. Ki Yung Ahn ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] How can I get rid of this link error?
Tom Nielsen tanielsen at gmail.com writes: have you tried cabal clean before cabal install ? Yeah, forgot to mention that I'd tried that. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Ridiculously slow FFI, or cairo binding?
Hi Axel, When do you expect to publish an updated version of gtk2hs on hackage? On Thu, Nov 3, 2011 at 1:02 PM, Eugene Kirpichov ekirpic...@gmail.com wrote: Hi, The actual thanks for tracking this down go to Vincent Hanquez for finding that we're doing a lot of gmp calls (and for making me aware of ltrace), and to Felipe Lessa for finding that this is caused by poor code generated for cFloatConv :) Your changes look identical to those that I made in my copy. On Thu, Nov 3, 2011 at 11:41 AM, Axel Simon axel.si...@in.tum.de wrote: Hi Eugene, On 02.11.2011, at 17:34, Eugene Kirpichov wrote: Heh. Guess what! A simple {-# INLINE cFloatConv #-} helped to the same extent! Axel, I think this change should be pretty easy to incorporate, and it probably makes sense to inline all other functions in Types.chs too. I've added INLINE pragmas to all these odd c2hs marshalling functions. Could you pull and check if I've done it correctly? Thanks for tracking this down! Axel Would you like me to send the trivial darcs patch or the gtk2hs team will take care of this? On Wed, Nov 2, 2011 at 7:29 PM, Felipe Almeida Lessa felipe.le...@gmail.com wrote: On Wed, Nov 2, 2011 at 11:24 AM, Jean-Marie Gaillourdet j...@gaillourdet.net wrote: Hi Eugene, did you try using the SPECIALIZE pragma? It is part of the Haskell 98 and Haskell 2010 specifications. I don't think it's going to make any difference, as the core already have an specialized poor version. See my first e-mail. -- Felipe. -- Eugene Kirpichov Principal Engineer, Mirantis Inc. http://www.mirantis.com/ Editor, http://fprog.ru/ -- Eugene Kirpichov Principal Engineer, Mirantis Inc. http://www.mirantis.com/ Editor, http://fprog.ru/ -- Eugene Kirpichov Principal Engineer, Mirantis Inc. http://www.mirantis.com/ Editor, http://fprog.ru/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Usage question with TemplateHaskell and Generic
2011/11/7 José Pedro Magalhães j...@cs.uu.nl: Hi, I'm not sure I understand your question. But if you mean that you want to retrieve the type variable names, as they were defined in the source, then I can tell you that the generic deriving mechanism cannot do this. Cheers, Pedro On Sun, Nov 6, 2011 at 14:35, Magicloud Magiclouds magicloud.magiclo...@gmail.com wrote: Hi, I'd like to simpler the work of deriving MyClass. And I have two ways to do: TemplateHaskell $(derivingMyClass), or Generic deriving (MyClass). Since I need to get the type name in the deriving, then I met this question: If I have data A b = C b, then with TemplateHaskell, the type would be VarT b, which means at compile time, I cannot get the exact type, so the type name would be b. So I wonder if this could be resolved by TemplateHaskell, or Generic is the only choice. PS: I have not tried to do this in Generic. -- 竹密岂妨流水过 山高哪阻野云飞 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe Thank you. After deeply thinking about this, GH sure does not -- 竹密岂妨流水过 山高哪阻野云飞 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Getting started on Mac OSX
Quoth hstenstrom h.stenst...@gmail.com, I have a book on Haskell, and I've downloaded and installed Haskell Platform for Mac OS X. What do I do now? XCode is a requirement, and I have it, but I don't know how to run it. To begin with, I want to test small examples from the book, using ghc or ghci. I have read file:///Library/Haskell/doc/start.html. - Where is the software I've just installed? - How is ghci started? Or the platform, whatever that is? The location of the software is covered in /Library/Haskell/doc/start.html. The key point is that the executables - like ghci - are in your path via /usr/bin. What they mean by should be available in any shell, is that when you run Terminal, you can just type ghci at the prompt. Terminal may be hiding in Applications/Utilities. Apple clearly underestimates the value of this application for its users, but you won't - you're going to be using Terminal a lot, for GHC. You need XCode only because GHC needs its compiler and libraries, you won't use XCode directly yourself just to run examples from the book. Donn ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Label macro expansion bug In HList.
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, o...@okmij.org 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). HList.cabal Description: Binary data ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Label macro expansion bug In HList.
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 aditya.si...@gmail.comwrote: 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, o...@okmij.org 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). ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Label macro expansion bug In HList.
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 aditya.si...@gmail.comwrote: 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 aditya.si...@gmail.comwrote: 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, o...@okmij.org 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). ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Data.Vector.Unboxed
If the internal vectors are fixed size, you can easily write a wrapper around Vector Int that converts (Int,Int) indices into indices in the sub-vector. If the internal vectors have dynamic size, you can't declare an Unbox instance, because pointers can't be unboxed; unboxed types are opaque to the garbage collector. At a low level, Vector Int is Vector Word# Word# ByteArray# where Word# are machine words and ByteArray# is like 'const char *' that is understood by the ghc garbage collector. On Wed, Nov 9, 2011 at 1:56 AM, kaffeepause73 kaffeepaus...@yahoo.dewrote: Hello, quick question about unboxed Vectors : Is it possible to create an unboxed vector of unboxed vector ? : import qualified Data.Vector.Unboxed as V type UnboxedNestedVextor = V.Vector (V.Vector Int) Alternatively I would have to use: import qualified Data.Vector.Unboxed as V import qualified Data.Vector as VB type UnboxedNestedVextor = VB.Vector (V.Vector Int) Is there a rule of thumb how much quicker Unboxed Vectors are ? Cheers Phil -- View this message in context: http://haskell.1045720.n5.nabble.com/Data-Vector-Unboxed-tp4977289p4977289.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Label macro expansion bug In HList.
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). ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Label macro expansion bug In HList.
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, o...@okmij.org wrote: 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). ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Label macro expansion bug In HList.
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 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Label macro expansion bug In HList.
Awesome! The samples now work. Thanks so much for your help. -deech On Fri, Nov 11, 2011 at 11:14 PM, o...@okmij.org wrote: 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 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe