Toby Miller wrote:
Here's what I came up with. I especially like the 2nd version, even though it's longer, as it seems very declarative.

caps1 s = all (\x -> isUpper (head x)) (words s)

caps2 s = all startsWithUpper (words s) where
    startsWithUpper w = isUpper (head w)


I'm also fairly new to Haskell, so I would appreciate feedback from the more experienced.

Thanks.

caps = all (isUpper . head) . words

But then, I'm strange like that...

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

Reply via email to