Re: [Haskell-cafe] Why am I not allowed to use CStringLen inforeignexport?

2006-09-23 Thread Brian Hulley
Andreas Marth wrote: low_l :: Word8 = fromIntegral (len .. 0x) low_h :: Word8 = fromIntegral (shiftR len 8 .. 0x) high_l :: Word8 = fromIntegral (shiftR len 16 .. 0x) high_h :: Word8 = fromIntegral (shiftR len 24 .. 0x) Hi - I just noticed the mask should be

Re: [Haskell-cafe] Trying to write a TCP proxy

2006-09-23 Thread Christian Sievers
John Ky wrote: I finally realised that hGetLine strips out the \n newline character so when I forward the line to the server, I need to append it again. Or use hPutStrLn instead of hPutStr ? (I may be missing something...) Bye Christian Sievers ___

[Haskell-cafe] Haskell Program

2006-09-23 Thread Tim Newsham
The company I work for was gracious enough to allow me to release a haskell program I wrote for them: http://www.isecpartners.com/file_fuzzers.html There's a python version and a rewrite in haskell. I used some looping constructs discussed earlier on this list to keep the haskell code

Re: [Haskell-cafe] Polymorphism/monomorphism (and the restriction)

2006-09-23 Thread Christian Sievers
Aaron McDaid wrote: This code experiments with Int, Float and (Num a) = a, and I tried to print x*2 and x/2 for each. (4::Int)/2 isn't allowed because / isn't defined for Ints. More exactly: (/) is a member function of the Fractional class, and Int is not an instance of this class. You

[Haskell-cafe] Re: [newbie] How to test this function?

2006-09-23 Thread Benjamin Franksen
Bruno Martínez [EMAIL PROTECTED] writes: On Thu, 21 Sep 2006 15:12:07 -0300, Benjamin Franksen [EMAIL PROTECTED] wrote: OK. Thanks. I didn't find that one because it's not offered as an identation option in emacs haskell mode. Emacs is evil! David House wrote: I'll ignore the

[Haskell-cafe] Haskell.org down

2006-09-23 Thread Donald Bruce Stewart
Just in case it has gone unnoticed, haskell.org seems to have been down for a few hours now. Do we have an admin looking into this? -- Don ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re[2]: [Haskell-cafe] Why am I not allowed to use CStringLen inforeignexport?

2006-09-23 Thread Bulat Ziganshin
Hello Brian, Friday, September 22, 2006, 9:03:01 PM, you wrote: withBSTR8 :: [Char] - (BSTR8 - IO a) - IO a withBSTR8 s f = bracket (createBSTR8 s) (\bstr - free (bstr `plusPtr` (-4))) (\bstr - f bstr) this may be shortened to

[Haskell-cafe] Re: [Haskell] MR details (was: Implicit type of numeric constants)

2006-09-23 Thread Bernie Pope
On 23/09/2006, at 4:33 AM, Christian Sievers wrote: Hello, I don't take my advice to go to haskell-cafe :-) I will take your advice :) The discussion continued outside the mailing list, and now I have two questions myself: 1. Why do the rules of the monomorphism restriction explicitly

Re: [Haskell-cafe] Haskell.org down

2006-09-23 Thread Paul Hudak
Thanks Don. I alerted our IT staff this morning, and they seem to have things working again, although here is their final response: The web server had over 150 client connections which exceeded its limit. I restarted the web server and all is well. I'll keep and eye on it and see if

Re: [Haskell-cafe] Haskell Program

2006-09-23 Thread Neil Mitchell
Cool! Were you going to tell us what the program does, or are we supposed to read the source and figure it out? From the web page: File Fuzzers These tools are useful for testing any program which processes binary file inputs such as archivers and image file viewers. FileP is a

[Haskell-cafe] Re: [newbie] How to test this function?

2006-09-23 Thread Stefan Monnier
First, how do I fix the identation of the if then else? getList = find 5 where find 0 = return [] find n = do ch - getChar if ch `elem` ['a'..'e'] then do tl - find (n-1) return (ch : tl) else find n OK. Thanks. I didn't find that one because it's not offered as an identation option

Re: [Haskell-cafe] Re: [Haskell] MR details (was: Implicit type of numeric constants)

2006-09-23 Thread Michael Shulman
On 9/23/06, Bernie Pope [EMAIL PROTECTED] wrote: If a pattern binding is not simple, it must have a data constructor on the lhs, therefore it cannot be overloaded. So the (dreaded) MR only applies to simple pattern bindings. I thought it was simple pattern bindings that could be *exempted*

[Haskell-cafe] Re: [newbie] How to test this function?

2006-09-23 Thread Stefan Monnier
For that one, if it doesn't get mended for long enough, Haskell' might accept the present layout. http://hackage.haskell.org/trac/haskell-prime/wiki/DoAndIfThenElse Hmm... the bug in haskell-mode has been known for almost a year now. So you're saying that I should just wait even more and it'll

Re: [Haskell-cafe] Re: [Haskell] MR details (was: Implicit type of numeric constants)

2006-09-23 Thread Bernie Pope
On 24/09/2006, at 1:46 AM, Michael Shulman wrote: On 9/23/06, Bernie Pope [EMAIL PROTECTED] wrote: If a pattern binding is not simple, it must have a data constructor on the lhs, therefore it cannot be overloaded. So the (dreaded) MR only applies to simple pattern bindings. I thought it

[Haskell-cafe] variadic functions and typeCast

2006-09-23 Thread Michael Shulman
Hi all, I am writing, for my own amusement, a more general version of the trick to implement variadic functions in Haskell outlined at http://okmij.org/ftp/Haskell/vararg-fn.lhs. (If someone else has done this already, please point me to it!) Code is attached at the end of the message. My

[Haskell-cafe] Unable to profile program using Data.ByteString.Lazy

2006-09-23 Thread Lyle Kopnicky
Hi folks, I wrote a program that uses some of the Data.ByteString libraries. I'm using GHC 6.4.1 and FPS 0.7. The program compiles and works just fine. But when I try to profile it, by compiling with -prof, I get: Failed to load interface for `Data.ByteString.Lazy': Could not

Re: [Haskell-cafe] Unable to profile program using Data.ByteString.Lazy

2006-09-23 Thread Donald Bruce Stewart
lists: Hi folks, I wrote a program that uses some of the Data.ByteString libraries. I'm using GHC 6.4.1 and FPS 0.7. The program compiles and works just fine. But when I try to profile it, by compiling with -prof, I get: Failed to load interface for `Data.ByteString.Lazy':

[Haskell-cafe] FFI and LD_PRELOAD - segfault

2006-09-23 Thread Stephan Walter
Hi, I'm trying to use a shared lib written in Haskell to overload C functions via LD_PRELOAD. You might think this is a bit silly, but hey, why not? I want to overload connect() from sys/socket.h. I'll document what I've written so far; unfortunately there doesn't seem to be a lot of

Re: [Haskell-cafe] Haskell.org down

2006-09-23 Thread Duncan Coutts
On Sat, 2006-09-23 at 09:58 -0400, Paul Hudak wrote: Thanks Don. I alerted our IT staff this morning, and they seem to have things working again, although here is their final response: The web server had over 150 client connections which exceeded its limit. I restarted the web

Re: [Haskell-cafe] Haskell.org down

2006-09-23 Thread Tony Morris
I have been linked before on slashdot to my humble web server (all 333MHz of awesome CPU power). I can attest to the effect that you are describing. Tony Morris http://tmorris.net/ Tomasz Zielonka wrote: On Sat, Sep 23, 2006 at 06:03:41PM +0200, Tomasz Zielonka wrote: Yesterday there was a

Re[2]: [Haskell-cafe] Haskell.org down

2006-09-23 Thread Bulat Ziganshin
Hello Paul, Saturday, September 23, 2006, 5:58:02 PM, you wrote: So either Haskell is getting really popular (on a Friday night?) or there's something fishy going on. are you sure that all haskellers live in England? ;) -- Best regards, Bulatmailto:[EMAIL

Re: [Haskell-cafe] Haskell.org down

2006-09-23 Thread Donald Bruce Stewart
paul.hudak: Thanks Don. I alerted our IT staff this morning, and they seem to have things working again, although here is their final response: The web server had over 150 client connections which exceeded its limit. I restarted the web server and all is well. I'll keep and eye