haskell-lectures/VL1/content/VL1_ADT2.tex

7 lines
231 B
TeX
Raw Normal View History

And we can again \emph{pattern match} on our \hinline{WeekDay} type. Let's find out if a given day is a Monday:
\pause
\begin{haskellcode}
isMonday :: WeekDay -> Bool
isMonday Monday = True
isMonday x = False
\end{haskellcode}