[Haskell-cafe] FFI and LD_PRELOAD - segfault

2006-09-23 Thread Stephan Walter
. Greetings, Stephan Walter ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: FFI and LD_PRELOAD - segfault

2006-09-24 Thread Stephan Walter
On Sun, 24 Sep 2006 20:20:55 +0300, Anatoly Zaretsky wrote: #include HsFFI.h extern void __stginit_Socks(void); static void __attribute__ ((constructor)) my_init(void) { int argc = 1; char *argv[] = {Haskell shared object}; char **argvp = argv; hs_init(argc, argvp);

[Haskell-cafe] Re: FFI and LD_PRELOAD - segfault

2006-09-24 Thread Stephan Walter
On Sun, 24 Sep 2006 21:37:32 +0300, Anatoly Zaretsky wrote: ghc -Wall -optl -shared -o libtestffi.so \ hsinit.c testffi.o testffi_stub.o Ok, that is even shorter. And it seems you don't have to call hs_add_root() or hs_exit(). At least for me it works with this hsinit.c: #include

[Haskell-cafe] Re: Best way to write endsWith

2006-10-21 Thread Stephan Walter
John Ky wrote: Hello, I have this function here: endsWith :: Eq a = [a] - [a] - Bool endsWith suffix list | lengthDifference 0 = False | otherwise = (drop lengthDifference list) == suffix where lengthDifference = (length list) - (length suffix) I thinks that's what

[Haskell-cafe] auto-completion for Vim 7

2007-03-04 Thread Stephan Walter
Hi, I started to write a Vim script for the new omni-completion feature of Vim 7. If you use Vim you might want to check it out: * download http://stephan.walter.name/files/haskellcomplete.vim and put it in ~/.vim/plugin * :set omnifunc=haskellcomplete#CompleteHaskell * press c-xc-o to complete

[Haskell-cafe] Re: auto-completion for Vim 7

2007-03-04 Thread Stephan Walter
Hi Neil, Neil Mitchell wrote: Using a recent version of haddock, the --hoogle flag gives you exactly what you want. I tried that but I guess I was too impatient to figure out what exactly haddock wants (it seemed to choke on #ifdefs), so I just used the hoogle.txt from darcs and ran it through

[Haskell-cafe] Re: Binary IO of a list of ints

2008-01-24 Thread Stephan Walter
Hi, On 2008-01-24 12:14, Jamie Love wrote: I have a list of ints, with values between 0 and 255 and I need to print them out in little endian form to a file. How about just using Data.Char.chr ? Prelude let a = [32..64] :: [Int] Prelude map Data.Char.chr a !\#$%'()*+,-./0123456789:;=?@