1. 6
  1.  

  2. 3

    A program only runs if its inputs (preconditions) are correct. That’s step 1. Next, make sure its outputs are in correct range or of correct type (postconditions). Finally, ensure conditions that should always hold during execution (invariants) do hold. Those three appled to each function/procedure are Dijkstra’s method for program correctness. Design-by-Contract does that, too.

    Maybe author just needs a DbC implementatiom for Haskell and corresponding tutorial.

    1. 1

      I think this is besides the point. The author explores several options on where to place which invariants for equivalent results, not whether to have them.