Name: Anonymous 2007-04-15 11:11 ID:00E9fssW
|code]isPrime x = (filter (0 ==) (map (mod x) [2..x-1])) == [][/code]
if a function? Observe:if :: Bool -> a -> a -> a
if True then _ = then
if False _ else = elseif functions in other languages you don't have to worry about both then and else both being evaluated when they could potentially be computationally expensive - thanks to Haskell's laziness you're guaranteed only one will be.