Send Beginners mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1.  Haskellers in St. Louis? (aditya siram)
   2.  Critique my Code! ([email protected])
   3.  Another request for code critique... (Mike Meyer)
   4. Re:  Another request for code critique... (Felipe Almeida Lessa)
   5. Re:  Critique my Code! (Christian Maeder)


----------------------------------------------------------------------

Message: 1
Date: Thu, 31 Mar 2011 10:22:12 -0500
From: aditya siram <[email protected]>
Subject: [Haskell-beginners] Haskellers in St. Louis?
To: haskell-cafe <[email protected]>, beginners
        <[email protected]>
Message-ID:
        <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1

Hi all,
I'm looking to start a Haskell user group in St. Louis, MO. Anyone
Haskellers or people interested in learning Haskell around these
parts?

-deech



------------------------------

Message: 2
Date: Thu, 31 Mar 2011 08:55:40 -0700
From: [email protected]
Subject: [Haskell-beginners] Critique my Code!
To: <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8; format=flowed

 Hi,

 I was hoping to get a code critique from some experienced Haskell 
 people.  I put my code up in this blog post:  
 
http://learnmeahaskell.blogspot.com/2011/03/playing-around-with-quickcheck.html 
 .

 thanks
 Lee





------------------------------

Message: 3
Date: Thu, 31 Mar 2011 14:18:32 -0400
From: Mike Meyer <[email protected]>
Subject: [Haskell-beginners] Another request for code critique...
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=US-ASCII

Shorter, but thing I've done that wasn't just an exercise from a
haskell book.

The problem statement can be found at
http://kernelbob.wordpress.com/2011/03/20/same-five-digits/.

My solution can be seen at http://pastebin.com/iW95q2ex.

   Thanks,
   <mike
-- 
Mike Meyer <[email protected]>             http://www.mired.org/consulting.html
Independent Software developer/SCM consultant, email for more information.

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org



------------------------------

Message: 4
Date: Thu, 31 Mar 2011 18:37:04 +0000
From: Felipe Almeida Lessa <[email protected]>
Subject: Re: [Haskell-beginners] Another request for code critique...
To: Mike Meyer <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8

On Thu, Mar 31, 2011 at 6:18 PM, Mike Meyer <[email protected]> wrote:
> Shorter, but thing I've done that wasn't just an exercise from a
> haskell book.
>
> The problem statement can be found at
> http://kernelbob.wordpress.com/2011/03/20/same-five-digits/.
>
> My solution can be seen at http://pastebin.com/iW95q2ex.

Some quick comments:

- Instead of '(== 0) . M.size', use 'M.null'.
- Instead of 'putStrLn . show', use 'print'.
- Why do you use M.map (head . show)?  Why not stick with the numbers?

Cheers,

-- 
Felipe.



------------------------------

Message: 5
Date: Fri, 01 Apr 2011 09:52:16 +0200
From: Christian Maeder <[email protected]>
Subject: Re: [Haskell-beginners] Critique my Code!
To: [email protected]
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Am 31.03.2011 17:55, schrieb [email protected]:
> Hi,
>
> I was hoping to get a code critique from some experienced Haskell
> people. I put my code up in this blog post:
> http://learnmeahaskell.blogspot.com/2011/03/playing-around-with-quickcheck.html
> .

Without trying to understand your code I'm disturbed by

a) duplicate code in factors' namely
      x `mod` y == 0 && y*y ...
      factors' x (y+1)

b) "sort $ nub" (even twice)

first sort and then removing duplicates can be more efficient, I would 
suggest: "Data.Set.toList . Data.Set.fromList"

c) using (head xs) and (tail xs) in "check" (without "null xs" test) 
looks suspicious. Use pattern matching on xs (instead of on number y)!

HTH Christian

>
> thanks
> Lee
>
>
>



------------------------------

_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 34, Issue 1
****************************************

Reply via email to