How to match pattern
Maybe (Either (Int, String) String)
I need to write function with such kind of input and how it is possible to parse such input?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
Maybe atype has the patternsJust aandNothing. TheEither a btype has the patternsLeft aandRight b. So a value of typeMaybe (Either (Int, String) String)can match the following patterns:NothingJust (Left (x,y))wherexis anIntandyis aStringJust (Right z)wherezis aString.