Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comment on tisket footgun. #137

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion content/language/hoon/reference/rune/tis.md
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,8 @@ Four arguments, fixed.

This is a bit like doing `=/` and `=.` at the same time. It's useful for state
machines, where you want to produce both effects and a new state. For example,
many arms of a Gall agent produce `[effects new-state]` in the form of a `(quip card _this)`. In the `++on-poke` arm, you might have something like:
many arms of a Gall agent produce `[effects new-state]` in the form of a
`(quip card _this)`. In the `++on-poke` arm, you might have something like:

```hoon
=^ cards state
Expand All @@ -619,6 +620,11 @@ many arms of a Gall agent produce `[effects new-state]` in the form of a `(quip

This may also remind you of Haskell's State monad.

Note that `=^` is subject to the same type nesting limitations as `=.`; e.g., if
you have `?~` checked a list for null, you can no longer nest a regular list in
the result. (In this case, use `?:(=(~ ...))` instead to preserve the `list`
rather than produce a `lest`.)

#### Examples

The `og` core is a stateful pseudo-random number generator.
Expand Down