Re: [Haskell-cafe] Regarding Haskell FFI

2012-03-28 Thread rajendra prasad
Thank you very much for the quick reply. Regards, Rajendra On Wed, Mar 28, 2012 at 2:35 PM, Simon Marlow wrote: > I think the fix eventually made its way into 7.4.1. This is the patch: > > http://hackage.haskell.org/**trac/ghc/changeset/** > d146fdbbf8941a8344f0ec300e79db**eabc08d1ea

Re: [Haskell-cafe] Regarding Haskell FFI

2012-03-28 Thread Simon Marlow
I think the fix eventually made its way into 7.4.1. This is the patch: http://hackage.haskell.org/trac/ghc/changeset/d146fdbbf8941a8344f0ec300e79dbeabc08d1ea Cheers, Simon On 28/03/2012 09:57, rajendra prasad wrote: Hi, I am using GHC version 7.0.4. Thanks, Rajendra On Wed, Mar

Re: [Haskell-cafe] Regarding Haskell FFI

2012-03-28 Thread rajendra prasad
Hi, I am using GHC version 7.0.4. Thanks, Rajendra On Wed, Mar 28, 2012 at 2:09 PM, Simon Marlow wrote: > On 27/03/2012 08:56, rajendra prasad wrote: > >> Hi, >> >> I am trying to load the DLL(Wrapper.dll) in my code(Main.hs). When I am >> placing the dll in local directory, I am able to lo

Re: [Haskell-cafe] Regarding Haskell FFI

2012-03-28 Thread Simon Marlow
On 27/03/2012 08:56, rajendra prasad wrote: Hi, I am trying to load the DLL(Wrapper.dll) in my code(Main.hs). When I am placing the dll in local directory, I am able to load it through following command: ghci Main.hs -L. -lWrapper But, I am not able to load it if I am putting it in some other

[Haskell-cafe] Regarding Haskell FFI

2012-03-27 Thread rajendra prasad
Hi, I am trying to load the DLL(Wrapper.dll) in my code(Main.hs). When I am placing the dll in local directory, I am able to load it through following command: ghci Main.hs -L. -lWrapper But, I am not able to load it if I am putting it in some other directory(../../bin). I used the following co

Re: [Haskell-cafe] Regarding Haskell FFI for C/C++ (Passing of String)

2012-03-27 Thread rajendra prasad
Thanks Yves for the reply. The link provided by you is very helpful. Thank you very much. Regards, Rajendra On Thu, Mar 22, 2012 at 7:53 PM, Yves Parès wrote: > (Sorry for the double post) > > Forget about ByteString.Char8: it doesn't handle unicode as it truncates > characters. > > Going from

Re: [Haskell-cafe] Regarding Haskell FFI for C/C++ (Passing of String)

2012-03-22 Thread Yves Parès
(Sorry for the double post) Forget about ByteString.Char8: it doesn't handle unicode as it truncates characters. Going from String to bytestring is easy thanks to the utf8-string ( http://hackage.haskell.org/packages/archive/utf8-string/0.3.7/doc/html/Codec-Binary-UTF8-String.html) package and pa

Re: [Haskell-cafe] Regarding Haskell FFI for C/C++ (Passing of String)

2012-03-22 Thread Yves Parès
This joins the question I asked two days ago here. (See http://haskell.1045720.n5.nabble.com/Quickest-way-to-pass-Text-to-C-code-td5582223.html ) Hope that helps. Le 22 mars 2012 15:10, rajendra prasad a écrit : > Hi, > > I have just started learning Haskell FFI. I am trying to send a string > f

[Haskell-cafe] Regarding Haskell FFI for C/C++ (Passing of String)

2012-03-22 Thread rajendra prasad
Hi, I have just started learning Haskell FFI. I am trying to send a string from hastell to a C function. For this, I am required to convert the haskell string to byte string. I have two methods to achieve this task. Both are listed below: 1) import Foreign.C.String let arg1 = map castCharToCC