The first name parser requires us to piece together the upper
and list lower
parser. We do
this using bindParser
and mapParser
. These two functions are turning out to be quite
helpful.
firstNameParser :: Parser String
firstNameParser = bindParser upper (\c -> mapParser (list lower) (\cs -> c : cs))
First Name: non-empty string that starts with a capital letter