This commit is contained in:
Aaro Koivukangas
2025-12-22 22:29:35 +02:00
parent 0d20281305
commit ccf3583da4
+5 -1
View File
@@ -132,7 +132,11 @@ data Student = Freshman | NthYear Int | Graduated
-- graduated student stays graduated even if he studies.
study :: Student -> Student
study = todo
study s = case s of
Freshman -> NthYear 1
NthYear 7 -> Graduated
NthYear n -> NthYear (n+1)
Graduated -> Graduated
------------------------------------------------------------------------------
-- Ex 7: define a datatype UpDown that represents a counter that can