Udo Stenzel [EMAIL PROTECTED] writes:
Friedrich wrote:
Ok to be more concrete is the laziness hidden here?
check_line line sum count =
let match = matchRegex regexp line
in case match of
Just strs - (sum + read (head strs) :: Integer, count + 1)
Udo Stenzel [EMAIL PROTECTED] writes:
Friedrich wrote:
Ok to be more concrete is the laziness hidden here?
check_line line sum count =
let match = matchRegex regexp line
in case match of
Just strs - (sum + read (head strs) :: Integer, count + 1)
.
We don't want to force subscribers to the main Haskell list to unsubscribe.
Thanks
Simon
| -Original Message-
| From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
| Behalf Of Friedrich
| Sent: 21 October 2008 08:18
| To: haskell@haskell.org
| Subject: Re: [Haskell] Probably a trivial
I think it might be more appropriate to move this discussion to
haskell-cafe.
On 19 okt 2008, at 17:24, Friedrich wrote:
Learn to love types: one of the neat things about Haskell is that if
you can write down the type of a function then you have usually done
90% of the work of writing the
Friedrich wrote:
Ok to be more concrete is the laziness hidden here?
check_line line sum count =
let match = matchRegex regexp line
in case match of
Just strs - (sum + read (head strs) :: Integer, count + 1)
Nothing - (sum, count)
Yes, part of
Friedrich wrote:
Taral [EMAIL PROTECTED] writes:
Wow, talk about doing everything by hand. :) There are a lot of
utility functions that make your life easier. Try this:
Given a strict pair, it should work:
import Control.Monad
import Data.Char
import Data.List
import
Thanks, I just figured out that I run out of file descriptors with
reading them all at once. But I probably can try the countDownloads
function. We'll see how that works.
Regards
Friedrich
___
Haskell mailing list
Haskell@haskell.org
I think it might be more appropriate to move this discussion to
haskell-cafe.
On 19 okt 2008, at 17:24, Friedrich wrote:
Learn to love types: one of the neat things about Haskell is that if
you can write down the type of a function then you have usually done
90% of the work of writing the
On Sun, Oct 19, 2008 at 11:39 PM, Chris Eidhof [EMAIL PROTECTED] wrote:
I think it might be more appropriate to move this discussion to
haskell-cafe.
On 19 okt 2008, at 17:24, Friedrich wrote:
Learn to love types: one of the neat things about Haskell is that if
you can write down the type
Jason Dagit [EMAIL PROTECTED] wrote:
Something I have noticed about myself now that I can think in types
to some degree is that reading the documentation for apis in
non-typeful languages, I'll pick on python, is now harder!
Well, something I have noticed is a definitive lack of documentation
Marshall Beddoe [EMAIL PROTECTED] writes:
Also, read some chapters from here:
http://book.realworldhaskell.org/read/
Indispensable examples for writing higher performance log processing
code.
I hope this book will soon be send out. I ordered my copy of course
;-)
Howerver even if Strings
On 2008 Oct 19, at 2:07, Friedrich wrote:
Howerver even if Strings are bad I can not see why they are hanging
around so long. I open a file a read it line by line and I close the
file so all read string are garbage and getting rid of them should
not be that hard or should it?
If your code is
On 2008 Oct 19, at 2:26, Friedrich wrote:
Paul Johnson [EMAIL PROTECTED] writes:
(By the way, putting in the top level type declarations helps a lot
when you make a mistake.)
Well I have my problems with that. Probably it comes from using
Languages like Ruby and my special dislike of typing
Brandon S. Allbery KF8NH [EMAIL PROTECTED] writes:
On 2008 Oct 19, at 2:07, Friedrich wrote:
Howerver even if Strings are bad I can not see why they are hanging
around so long. I open a file a read it line by line and I close the
file so all read string are garbage and getting rid of them
On 2008 Oct 19, at 11:18, Friedrich wrote:
Brandon S. Allbery KF8NH [EMAIL PROTECTED] writes:
On 2008 Oct 19, at 2:07, Friedrich wrote:
Howerver even if Strings are bad I can not see why they are hanging
around so long. I open a file a read it line by line and I close the
file so all read
Brandon S. Allbery KF8NH [EMAIL PROTECTED] writes:
On 2008 Oct 19, at 2:26, Friedrich wrote:
Paul Johnson [EMAIL PROTECTED] writes:
(By the way, putting in the top level type declarations helps a lot
when you make a mistake.)
Well I have my problems with that. Probably it comes from using
Brandon S. Allbery KF8NH [EMAIL PROTECTED] writes:
On 2008 Oct 19, at 2:07, Friedrich wrote:
Howerver even if Strings are bad I can not see why they are hanging
around so long. I open a file a read it line by line and I close the
file so all read string are garbage and getting rid of them
On 2008 Oct 19, at 11:24, Friedrich wrote:
Brandon S. Allbery KF8NH [EMAIL PROTECTED] writes:
The relationship
between types and proofs is especially obvious in Haskell. And
proofs
aren't merely mathematical entities, they're expressions of what you
want to accomplish: if you can type your
On 2008 Oct 19, at 11:25, Friedrich wrote:
Ok to be more concrete is the laziness hidden here?
check_line line sum count =
let match = matchRegex regexp line
in case match of
Just strs - (sum + read (head strs) :: Integer, count
+ 1)
Nothing - (sum,
Brandon S. Allbery KF8NH [EMAIL PROTECTED] writes:
Laziness is a double-edged sword.
Perhaps the following page from Haskell Wiki would serve to enlighten
more: http://haskell.org/haskellwiki/Foldr_Foldl_Foldl%27? This
really made it clear to me how laziness can sometimes be a bad thing.
Chry Cheng schrieb:
Brandon S. Allbery KF8NH [EMAIL PROTECTED] writes:
Laziness is a double-edged sword.
Perhaps the following page from Haskell Wiki would serve to enlighten
more: http://haskell.org/haskellwiki/Foldr_Foldl_Foldl%27? This
really made it clear to me how laziness can
Friedrich wrote:
Ok to be more concrete is the laziness hidden here?
check_line line sum count =
let match = matchRegex regexp line
in case match of
Just strs - (sum + read (head strs) :: Integer, count + 1)
Nothing - (sum, count)
Probably.
Taral [EMAIL PROTECTED] writes:
On Sat, Oct 18, 2008 at 1:50 AM, Friedrich
[EMAIL PROTECTED] wrote:
I've written just a few programs in Haskell one in a comparison for a
task I had nearly daily.
The code analyzes Apache logs and picks some certain stuff from it and
after that calculates a
Friedrich wrote:
Paul Johnson [EMAIL PROTECTED] writes:
[...] Because file reading is lazy,
each line is only read when it is to be processed, and then gets
reaped by the garbage collector. So it all runs in constant memory.
Would you mind to elaborate a bit about it. What's so
Friedrich wrote:
I've written just a few programs in Haskell one in a comparison for a
task I had nearly daily.
The first thing I notice is that this is clearly a direct translation
from something like Perl. Thats understandable, but I'd suggest
rewriting it with something like this
25 matches
Mail list logo