Gjuro Chensen wrote:
> startsWithUpper :: String -> Bool
> startsWithUpper []= False
> startsWithUpper string =
>       if myIsUpper(head(string)) then True 
>       else False

It is very good that you caught the issue of taking the head of an empty
list :)
I saw here and also below, that you did things like
if P then True else False
You can shorten this to 'P'.

Also, normally Haskellers like to pattern match, changing the second
clause of your function into
startsWithUpper (x:xs) = myIsUpper x

> check :: [String] -> Bool
> check []=False

Why is this False and not True? Certainly in the empty string all words
start with an uppercase letter, don't they? (If it's True, you can even
remove this clause, and let the other one take care of the rest.)

Regards,

-- 
Jochem Berndsen | joc...@functor.nl
GPG: 0xE6FABFAB
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to