Hey guys, I’m new in the forum and the language too. Can you help me, please ?
I bought this book to study Haskell, but I’m stuck in this exercise.
Create a “Day” type with the days of the week. Make a function that receives a “Days” list and filter “Tuesdays”
I created the Day type:
data Day = Monday | Tuesday | Wednesday | Thursday | Friday | Saturday | Sunday deriving Show
But I’m stuck now. I tried using filter alone but it didn’t work
filter (Tuesday) = [Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday]
Can someone help me, please ? And I know that there’s a better way to do it, I’d really appreciate if someone tell me.
Thanks for your help.