Re: [Haskell-cafe] beginner's problem about lists

2006-10-19 Thread Eugene Crosser
On Tue, 10 Oct 2006 [EMAIL PROTECTED] wrote: Hi all, I'm trying to implement a function that returns the shorter one of two given lists, something like shorter :: [a] - [a] - [a] such that shorter [1..10] [1..5] returns [1..5], and it's okay for shorter [1..5] [2..6] to return either.

Re: [Haskell-cafe] beginner's problem about lists

2006-10-19 Thread Eugene Crosser
Sorry, I realized that it does not cover the shorter [1..5] (shorter [2..] [3..]) case... Eugene Crosser wrote: On Tue, 10 Oct 2006 [EMAIL PROTECTED] wrote: Hi all, I'm trying to implement a function that returns the shorter one of two given lists, something like shorter

Re: [Haskell-cafe] Unix gurus, help me please

2006-07-17 Thread Eugene Crosser
Bulat Ziganshin wrote: - I include file io.h, but this particular system has sys/io.h instead. Just out of the blue: could it be that you rather need fcntl.h? It's the place where open() and friends are defined. Maybe(?) windows have them in io.h... - mingw supports _commit operation which

Re: [Haskell-cafe] [newbie] processing large logs

2006-05-14 Thread Eugene Crosser
Udo Stenzel wrote: Eugene Crosser wrote: This is my program: module Main where import Data.Map main = printMax . (foldr processLine empty) . lines = getContents processLine line map = insertWith (\new old - new + old) line 1 map printMax map = putStrLn $ show $ foldWithKey

Re: [Haskell-cafe] [newbie] processing large logs

2006-05-14 Thread Eugene Crosser
Udo Stenzel wrote: Eugene Crosser wrote: Having read Yet another Haskell tutorial (note on p.20), doesn't foldl have to read the complete list before it can start processing it (beginning from the last element)? As opposed to foldr that can fetch elements one by one as they are needed

[Haskell-cafe] [newbie] processing large logs

2006-05-13 Thread Eugene Crosser
Hello gentlemen, I am exposed to functional programming for less than a month, and just trying to understand the concepts, so please bear with me. I tried to use Haskell for a simple task on my dayjob, that involved parsing mail system logs and counting distinct addresses (I work for a