Commit Graph

5 Commits

Author SHA1 Message Date
Veit Heller
d3a6ca562f
docs: document core modules (#1271) 2021-07-05 14:48:35 +02:00
Scott Olsen
d8d3669a16
feat: add 'when' functions for Maybe and Result (#1180)
* feat: add 'when' functions for Maybe and Result

These functions enable users to execute some side-effecting function
(one that returns unit and take no arguments) based on the contents of a
Maybe or Result.

`when-success`: Executes a side-effect when given a `Result.Success`
`when-error`: Executes a side-effect when given a `Result.Error`
`when-just`: Executes a side-effect when given a `Maybe.Just`
`when-nothing`: Executes a side-effect when given a `Maybe.Nothing`

* docs: add Control to core lib doc generation
2021-03-15 09:53:22 +01:00
scottolsen
f819f083cc Fix signature of Control.iterate-until
Now that sigs work, turns out the signature for iterate-until and it's
definition don't match.

There was an extra argument in the sig, which I've removed. Adding a ref
to `result` also confused the type checker, since result technically has
two types in the definition whenever `b` is not a ref. I believe the
side effect of this change is that the `start` argument must now be a
`Ref`, but at least it's well-typed.
2020-05-20 23:40:46 -04:00
Erik Svedäng
c42ffec862 Ref result. 2020-04-29 09:48:37 +02:00
Erik Svedäng
de8104eb14 Add Control.iterate-until. 2020-04-28 14:48:39 +02:00