on master help sign in
Adjust ST makeAndIncrement example type

`Int -> ST m Int []` is incompatible with previous examples which use `Integer`. When using `Int` in the type of `makeAndIncrement`, you'll get something like this: ``` - + Errors (1) `-- ST.idr line 20 col 27: When checking right hand side of makeAndIncrement with expected type STrans m Int [] (\result => []) When checking an application of function Control.ST.>>=: Error in state transition: Operation has preconditions: [x ::: State Integer] States here are: [var ::: State Int] Operation has postconditions: \result => [x ::: State Integer] Required result states here are: st2_fn ```

commit4c95e68f8ff14be4dfcbea65ca5aed2f2622c3a7 authorAndrew Bruce <me@andrewbruce.net> dateSun 3 Dec 2017, 18:57 (9 years ago) parent4064dcf
1 file changed+1−1
docs/st/state.rst+1−1
docs/st/state.rst+1−1
@@ -594,7 +594,7 @@ That is, ``increment`` begins and ends with ``x`` in state ``State Integer``.
594594
595595.. code-block:: idris
596596
597− makeAndIncrement : Int -> ST m Int []
597+ makeAndIncrement : Integer -> ST m Integer []
598598
599599That is, ``makeAndIncrement`` begins and ends with no resources.
600600