Re: Re[2]: [Haskell-cafe] Records (was Re: [Haskell] Improvements to GHC)

2005-11-21 Thread Max Eronin
On 11/18/05, Sebastian Sylvan [EMAIL PROTECTED] wrote:

 I'm not saying it's impossible to make good use of (.), I'm saying
 that it's not crucial enough to warrant giving it the dot, which in my
 opinion is one of the best symbols (and I'd hand it over to record
 selection any day of the week!).
 I'm also saying that people tend to abuse the (.) operator when they
 start out because they think that less verbose == better, whereas
 most people, in my experience, tend to stop using (.) for all but the
 simplest cases (such as filte (not . null)) after a while to promote
 readability. I prefer adding a few lines with named sub-expressions to
 make things clearer.


In case someone counts votes pro et contra of replacing (.) operator,
I must say that find it one of the most useful and readable way for
doing many different things (not only higher-order). And very compact
too.
And in my code it is very common operator.
While if somebody, who at this moment counts my vote, will remove
records from the language some day, I very likely wouldn't notice such
a loss.
And I can't say I'm very experienced haskell programmer. Actually I'm
a beginner comparing my experience with other, particularly imperative
OOP languages.
And records with (.) as field selector (coupled with dumb
constructors) will be the last thing i would miss in haskell.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re[2]: [Haskell-cafe] Records (was Re: [Haskell] Improvements to GHC)

2005-11-19 Thread Bulat Ziganshin
Hello John,

Saturday, November 19, 2005, 2:25:47 AM, you wrote:

JM  grep -o ' [-+.*/[EMAIL PROTECTED] ' GenUtil.hs | sort | uniq -c | sort -n
JM  30  .

JM one of the most common operators.

especially in comments ;)  add the following filter to strip them:

import System.Environment

main = interact (noStream.(unlines.map noEnd.lines))

noStream ('{':'-':xs) = noInStream xs
noStream (c:xs)   = c:noStream xs
noStream= 

noInStream ('-':'}':xs) = noStream xs
noInStream (_:xs)   = noInStream xs
noInStream= 

noEnd ('-':'-':xs) = 
noEnd (c:xs)   = c:noEnd xs
noEnd= 


-- 
Best regards,
 Bulatmailto:[EMAIL PROTECTED]



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe