Q: How can I create a lowercase checker? I'm having trouble understanding how this recursion works, for example, if I want to make a String -> Boolean exercise to know if the string has a lower case in it how can i do it?This is my big amateur code, thats not even running the list properly, although I don't know any better:
lowercase (x:xs) | isLower x lowercase xs = True
                 | otherwise = False


A: You have a good idea, but bad syntax.
lowercase :: String -> Bool
lowercase [] = True -- this case is needed to ensure that recursion stops
lowercase (x:xs) | isLower x = lowercase xs
lowercase _ = False

Or, using standard library,
lowercase = all isLower


A: How about:
lowercase (x:xs) = if isLower x
                     then lowercase xs
                     else False

But you still need to cover the empty string case:
lowercase [] = ???

Also note that there is no need to test if a boolean equals True or False explicitly. I.e. instead of if boolexpr == True ... just use if boolexpr ...
