Re: [Haskell-cafe] Re: Space Leak Help

2007-02-04 Thread Anatoly Zaretsky
On 2/4/07, Dominic Steinitz [EMAIL PROTECTED] wrote: pad causes a stack overflow and pad1 uses up about 6m of heap. pad = pad' 0 where pad' l [] = [0x80] ++ ps where pl = (64-(l+9)) `mod` 64 ps = replicate pl 0x00 pad' l (x:xs) = x : pad' (l+1) xs pad =

Re: [Haskell-cafe] Another Space Leak

2007-02-04 Thread Anatoly Zaretsky
On 2/4/07, Dominic Steinitz [EMAIL PROTECTED] wrote: test1 :: Int - [Word8] test1 n = foldl' (zipWith xor) [0x01..0x40] (blockWord8sIn512 (pad (replicate n 0x55))) test2 :: Int - [Word8] test2 n = foldl' (zipWith xor) [0x01..0x40] (bws (pad (replicate n 0x55))) The problem really is here:

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

2006-09-24 Thread Anatoly Zaretsky
On 9/23/06, Stephan Walter [EMAIL PROTECTED] wrote: I'm trying to use a shared lib written in Haskell to overload C functions via LD_PRELOAD. [snip] This aborts with a segfault in scheduleWaitThread() from ./libtestffi.so The test program doesn't use threads, so I'm wondering what I did

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

2006-09-24 Thread Anatoly Zaretsky
On 9/24/06, Stephan Walter [EMAIL PROTECTED] wrote: gcc -g -Wall -I/usr/lib/ghc-6.4.2/include -c -o hsinit.o hsinit.c or ghc -c hsinit.c or even ghc -Wall -optl -shared -o libtestffi.so \ hsinit.c testffi.o testffi_stub.o Could anybody familiar with ghc linking details comment on

Re: [Haskell-cafe] Why is type 'b' forced to be type 'm a' and not possibly 'm a - m a'

2006-09-15 Thread Anatoly Zaretsky
On 9/15/06, Vivian McPhail [EMAIL PROTECTED] wrote: class Forkable a where fork :: String - a - a - a ... {- instance (Monad m, Forkable (m a), Forkable b) = Forkable (m a - b) where fork n a1 a2 a = do a' - a fork n (a1 $ return a') (a2 $

Re: [Haskell] How to generate a dll?

2006-09-07 Thread Anatoly Zaretsky
On 9/7/06, Andreas Marth [EMAIL PROTECTED] wrote: I meant that the dll crashed Excel wenn I stopped the debugging mode and also if I used it in a VB-projekt it crahed that when stopped. Hi, Andreas! Try adding these lines to your DllMain: if (reason == DLL_PROCESS_DETACH) {

Re: [Haskell] using the ffi with callbacks

2006-07-20 Thread Anatoly Zaretsky
On 7/20/06, Evan Martin [EMAIL PROTECTED] wrote: To elaborate, the code setting this up looks something like this: callback_fcn - ... -- get a FunPtr using wrapper from the ffi free_fcn - ... -- as above -- the callback data is just stuff that needs freeing callback_data - newStablePtr

Re: [Haskell-cafe] Arrows and 'do' syntax

2006-07-12 Thread Anatoly Zaretsky
On 7/12/06, Greg Fitzgerald [EMAIL PROTECTED] wrote: I'm trying to translate this HXT code to use the Arrow 'do' syntax: readWriteDoc :: String - IOSLA (XIOState s) b Int readWriteDoc path = readDocument [(a_validate, 0)] path writeDocument [(a_output_encoding, isoLatin1)] -

Re: [Haskell-cafe] Re: socket TChan problem

2006-02-28 Thread Anatoly Zaretsky
Why do you need to duplicate channels? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe