[Haskell-cafe] new Haskell hacker seeking peer review

2005-02-18 Thread Sean Perry
I am learning Haskell, so I decided to implement everyone's favorite, overused Unix command -- cat. Below is my simple implementation, comments about style, implementation, etc. are welcomed. In particular, is my untilEOF idiomatically ok? Is there a better way to accomplish this? Also, while

Re: [Haskell-cafe] new Haskell hacker seeking peer review

2005-02-18 Thread Bernard Pope
On Fri, 2005-02-18 at 01:58 -0800, Sean Perry wrote: I am learning Haskell, so I decided to implement everyone's favorite, overused Unix command -- cat. Below is my simple implementation, comments about style, implementation, etc. are welcomed. In particular, is my untilEOF idiomatically ok?

Re: [Haskell-cafe] new Haskell hacker seeking peer review

2005-02-18 Thread Jules Bean
Hi Sean, I'm not expert, but since you asked for idiomatic comments, here are a few... On 18 Feb 2005, at 09:58, Sean Perry wrote: Also, while talking about untilEOF, it is slightly annoying that hIsEOF returns IO Bool and that functions like 'not' only want Bool. Sure makes the logic tests feel

[Haskell-cafe] new Haskell hacker seeking peer review

2005-02-18 Thread Sean Perry
I am learning Haskell, so I decided to implement everyone's favorite, overused Unix command -- cat. Below is my simple implementation, comments about style, implementation, etc. are welcomed. In particular, is my untilEOF idiomatically ok? Is there a better way to accomplish this? Also, while

[Haskell-cafe] Re: new Haskell hacker seeking peer review

2005-02-18 Thread John Goerzen
Here's an alternative: module Main where import System.IO import System(getArgs) catFile :: FilePath - IO () catFile fp = do contents - readFile fp putStr contents main :: IO () main = do hSetBuffering stdin (BlockBuffering Nothing) args - getArgs if not

Re: [Haskell-cafe] Problems with building GCJNI 1.2

2005-02-18 Thread Dmitri Pissarenko
Did you import Foreign.GreenCard? Now, I replaced import StdDIS by import Foreign.GreenCard. The warning concerning missing import file does not occur any more, but the marshall errors are still there. Here is make's output: make-output make -C src make[1]: Entering directory

Re: [Haskell-cafe] Problems with building GCJNI 1.2

2005-02-18 Thread Lemmih
On Fri, 18 Feb 2005 20:37:35 +0100, Dmitri Pissarenko [EMAIL PROTECTED] wrote: Did you import Foreign.GreenCard? Now, I replaced import StdDIS by import Foreign.GreenCard. The library apparently wasn't designed for newer versions of GreenCard and it may be too old to fix easily. --

[Haskell-cafe] Literate Haskell

2005-02-18 Thread Dmitri Pissarenko
Hello! I'm curious what experienced Haskellers think about using literate Haskell in daily work. It seems to me like a good idea, since during coding it often helps to write down one's thoughts (often, I find a solution to a complicated problem in this way). What are your experiences with

[Haskell-cafe] Strange HTTP module behavior

2005-02-18 Thread John Goerzen
Hello, I am trying to send a simple SOAP message to an Apache server. I got the HTTP library from the XML-RPC library and thought this would make an easy client. However, I'm having two problems. First, even though I am sending an accurate Content-Length header with my POST message, the server

[Haskell-cafe] Re: Strange HTTP module behavior [PATCH]

2005-02-18 Thread John Goerzen
On 2005-02-18, John Goerzen [EMAIL PROTECTED] wrote: First, even though I am sending an accurate Content-Length header with my POST message, the server is timing out and returning a 500 Internal Server Error document. Looks like that was a server bug. Second, after reading that error

[Haskell-cafe] Re: Strange HTTP module behavior [PATCH]

2005-02-18 Thread John Goerzen
On Fri, Feb 18, 2005 at 11:36:57PM +0100, Bjorn Bringert wrote: John Goerzen wrote: It turns out that Network.Socket.recv raises an EOF error when it gets back 0 bytes of data. HTTP is expecting it to return an empty list for some reason. The below patch fixed it for me. [...] Hmm,

[Haskell-cafe] Alternative lambda syntax (not entirely serious)

2005-02-18 Thread Fritz Ruehr
I was introducing a fresh set of students to lambda abstraction in Haskell yesterday and had the following inspiration about a possible alternative syntax. I didn't end up showing the idea to the students -- too confusing -- but I thought I would float it here, as long as nobody takes it too

Re: [Haskell-cafe] Literate Haskell

2005-02-18 Thread Mark Carroll
On Fri, 18 Feb 2005, Dmitri Pissarenko wrote: I'm curious what experienced Haskellers think about using literate Haskell in daily work. It seems to me like a good idea, since during coding it often helps to write down one's thoughts (often, I find a solution to a complicated problem in this

Re: [Haskell-cafe] Re: new Haskell hacker seeking peer review

2005-02-18 Thread Isaac Jones
John Goerzen [EMAIL PROTECTED] writes: Here's an alternative: module Main where (snip john's version) And what list would be complete without a points-free version. It doesn't operate on stdin, though like John's does: pointsFreeCat :: IO () pointsFreeCat = getArgs = mapM readFile =

Re: [Haskell-cafe] Re: new Haskell hacker seeking peer review

2005-02-18 Thread Dean Herington
At 5:27 PM -0800 2/18/05, Isaac Jones wrote: John Goerzen [EMAIL PROTECTED] writes: Here's an alternative: module Main where (snip john's version) And what list would be complete without a points-free version. It doesn't operate on stdin, though like John's does: pointsFreeCat :: IO ()

Re: [Haskell-cafe] Literate Haskell

2005-02-18 Thread Andrew Pimlott
On Fri, Feb 18, 2005 at 09:21:00PM +0100, Dmitri Pissarenko wrote: I'm curious what experienced Haskellers think about using literate Haskell in daily work. This isn't a deep answer, but I find both of Haskell's literate syntaxes more trouble than they're worth. The leading syntax makes a