Skip to content

Latest commit

 

History

History
66 lines (62 loc) · 860 Bytes

ch23.adoc

File metadata and controls

66 lines (62 loc) · 860 Bytes

23 State

23.5 Throw down

Exercises

  1. rollsToGetN

    link:ch23_23.5_1.hs[role=include]
  2. rollsCountLogged

    link:ch23_23.5_2.hs[role=include]

23.6 Write State for yourself

Looks legit and compiles, what can go wrong? :)

link:ch23_23.6_1.hs[role=include]

23.7 Get a coding job with one weird trick

More of a list thing than state…​.

link:ch23_23.7_1.hs[role=include]

23.8 Chapter exercises

  1. get

    link:ch23_23.8_1.hs[role=include]
  2. put

    link:ch23_23.8_2.hs[role=include]
  3. exec

    Warning
    There is no data constructor State to pattern match on. Bug in the book?
    link:ch23_23.8_3.hs[role=include]
  4. eval

    Warning
    same as with exec
    link:ch23_23.8_4.hs[role=include]
  5. modify

    link:ch23_23.8_5.hs[role=include]