Following is the example I have reproduced:
charName :: Char -> String
charName ‘a’ = “Albert”
charName ‘b’ = “Broseph”
charName ‘c’ = “Cecil”
charName x = “Not defined yet”
Can I further modify above mentioned code to something like below (will not compile):
charName :: Char -> String
charName ‘a’ or ‘A’ = “Albert”
charName ‘b’ or ‘B’ = “Broseph”
charName ‘c’ or ‘C’ = “Cecil”
charName x or X= “Not defined yet”
In order to get “Albert” if charName ‘a’ or charName ‘A’ given.
Please guide how to write above mentioned code in possible shortest manner.
Another option is: