> From: Daniel Carrera <[EMAIL PROTECTED]>
> Robert Dockins wrote:
> > -divides a b = (mod a b == 0)
> > +divides a b = (mod b a == 0)
> 
> Oh, thanks. My program assumed one way to define 'divides' 
> and the example assumed the other.
> 
> When I wrote it I was thinking of (divides a) being a 
> function that tells me if the input divides 'a'.
> 
> Thanks!
> 
> Cheers,
> Daniel.

Daniel, 

Have you used Haskell's infix notation? It can help keep the order
straight for operators like these. You can write

a `mod` b  -- instead of mod a b
a `divides` b -- instead of divides a b.

This can help with readability, too.

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

Reply via email to