Skip to content

Instantly share code, notes, and snippets.

@okram
Created December 4, 2019 19:00
Show Gist options
  • Save okram/58aa407a4a38f037bc912ef6b2e502d6 to your computer and use it in GitHub Desktop.
Save okram/58aa407a4a38f037bc912ef6b2e502d6 to your computer and use it in GitHub Desktop.
// monad state such as path-histories are encoded using reflection and self-modifying instructions
**************************************************
* [choose, *
* [get,'value'] -> 5 *
* [get,'path'] -> [1,2,3,4] *
* [plus,[zero] -> [id] *
* [mult,[one]] -> [id] * *************************
* [minus,[zero]] -> [id] * => [plus,1] => * ...[get,'value'] -> 6 *
* inst -> [sideeffect, * *************************
* [get,'path'] *
* [add,[get,'value']]] *
* [eval,[id]]] *
**************************************************
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment