Re: [Haskell-cafe] FFI question - FunPtrs to top-level functions

2011-08-18 Thread kyra
On 8/18/2011 6:49 AM, Antoine Latter wrote: Hi Haskell, I have a question about the Haskell FFI and creating FunPtrs to Haskell functions. Does anyone have any recommendations for when I have a top-level function that I would like to pass to a C function as a function pointer (that is called

Re: [Haskell-cafe] Existential question

2011-08-18 Thread Miguel Mitrofanov
Now, what we can do with kl1? We can feed it an integer, say 1, and obtain function f of the type s - (s,Bool) for an _unknown_ type s. Informally, that type is different from any concrete type. We can never find the Bool result produced by that function since we can never have any concrete

[Haskell-cafe] conditionally exposing modules in cabal

2011-08-18 Thread Rogan Creswick
I would like to conditionally expose a number of internal modules in a library depending on a cabal flag - the idea is that new features could be implemented externally to the library without contaminating the source with undesirable changes. However, I've been unable to find a way to structure a

Re: [Haskell-cafe] conditionally exposing modules in cabal

2011-08-18 Thread Antoine Latter
On Thu, Aug 18, 2011 at 3:33 AM, Rogan Creswick cresw...@gmail.com wrote: I would like to conditionally expose a number of internal modules in a library depending on a cabal flag - the idea is that new features could be implemented externally to the library without contaminating the source

Re: [Haskell-cafe] conditionally exposing modules in cabal

2011-08-18 Thread Rogan Creswick
On Thu, Aug 18, 2011 at 4:41 AM, Antoine Latter aslat...@gmail.com wrote: One problem to consider - a downstream user of the new features won't know that they need to pass special flags to your module, and may not even know that they are using your module if the dependency is a few steps

[Haskell-cafe] Gaussian elimination

2011-08-18 Thread Tobias Nipkow
Hi, I came up with the following extremely compact version of Gaussian elimination for matrices represented as functions. I searched the web but found nothing resembling it, probably because of its inefficiency. Has anybody seen something like it before? Thanks Tobias gauss :: Int - (Int - Int -

Re: [Haskell-cafe] writing a good Setup.hs is *hard* (was: broken on install encoding 0.6.6)

2011-08-18 Thread malcolm.wallace
On 17 Aug, 2011,at 03:11 PM, Rogan Creswick cresw...@gmail.com wrote:encoding-0.6.6 uses it's own source during the build process! It actually has to be partially compiled before the build tool can build encoding (!). I'm *amazed* that this actually works at all (impressed, too), This is by

Re: [Haskell-cafe] Compilation error in Chapter 5 of Real World Haskell

2011-08-18 Thread Jason Dagit
On Wed, Aug 17, 2011 at 10:37 AM, Paul Reiners paul.rein...@gmail.com wrote: I'm trying to do the following from Chapter 5 of Real World Haskell: Our choice of naming for the source file and function is deliberate. To create an executable, ghc expects a module named Main that contains a

Re: [Haskell-cafe] Compilation error in Chapter 5 of Real World Haskell

2011-08-18 Thread Thomas DuBuisson
This is a linking issue. It seems GHC 7 automatically feeds the linker SimpleJSON.o so when you explicitly provide it too then you get those conflicts. All you need to do is call: ghc -o simple Main.hs Unless you're using GHC 6, then the original command is correct: ghc -o simple Main.hs

[Haskell-cafe] Failed link to mixed-language shared object.

2011-08-18 Thread David Banas
Hi all, Does this trigger recollection in anyone: dbanas@dbanas-eeepc:~/prj/haskell/AMIParse/trunk$ make ghc -dynamic -o ami_test -L. -lami ami_test.o ./libami.so: undefined reference to `__stginit_haskell98_MarshalArray_' ./libami.so: undefined reference to `__stginit_haskell98_MarshalError_'

Re: [Haskell-cafe] Failed link to mixed-language shared object.

2011-08-18 Thread Brandon Allbery
On Thu, Aug 18, 2011 at 23:32, David Banas dba...@banasfamily.net wrote: Does this trigger recollection in anyone: dbanas@dbanas-eeepc:~/prj/haskell/AMIParse/trunk$ make ghc -dynamic -o ami_test -L. -lami ami_test.o ./libami.so: undefined reference to `__stginit_haskell98_MarshalArray_'

[Haskell-cafe] custom SQL-to-Haskell type conversion in HDBC

2011-08-18 Thread Henry House
Does there exist any sample code or other resources on writing a custom SQL-to-Haskell datatype converter instance for use with HDBC that would be accessible to someone just starting with Haskell? The reason I need this is because of this problem (using PostgreSQL): Prelude