Looks legit and compiles, what can go wrong? :)
link:ch23_23.6_1.hs[role=include]
More of a list thing than state….
link:ch23_23.7_1.hs[role=include]
-
get
link:ch23_23.8_1.hs[role=include]
-
put
link:ch23_23.8_2.hs[role=include]
-
exec
WarningThere is no data constructor State
to pattern match on. Bug in the book?link:ch23_23.8_3.hs[role=include]
-
eval
Warningsame as with exec
link:ch23_23.8_4.hs[role=include]
-
modify
link:ch23_23.8_5.hs[role=include]