Using isUpper, isLower, and isDigit in Haskell

Viewed 11251

I am having trouble with how to use isUpper, isLower, and isDigit. Specifically I am trying to take a string and return a list of tuples for each character in the string containing three Bool values for if the character is an uppercase letter, a lowercase letter, or a digit. So the string "Ab2" would return the list [(True, False, False), (False, True, False), (False, False, True)]. This is what I have:

import Data.Char
uppercaseList :: [a] -> [(Bool, Bool, Bool)]
uppercaseList xs = [(isUpper, isLower, isDigit)]

I think I need to pass the character of the string into isUpper, isLower, and isDigit, but I don't see how to. I'm sorry if this is a dumb question, but nothing I've found addresses my confusion so far.

2 Answers
Related