aboutsummaryrefslogtreecommitdiffhomepage
path: root/std/Monad/State.bruijn
diff options
context:
space:
mode:
authorMarvin Borner2024-11-27 15:16:11 +0100
committerMarvin Borner2024-11-27 15:16:11 +0100
commit4b38d1af08288e80a29c84fe02a40ac925331f21 (patch)
treeba2e959966c1fb4ccb521cf41aaeb7fe2005d775 /std/Monad/State.bruijn
parent96c3527d87766f3fb653c31306eb78317dcbc1cf (diff)
Monad improvements
Diffstat (limited to 'std/Monad/State.bruijn')
-rw-r--r--std/Monad/State.bruijn5
1 files changed, 5 insertions, 0 deletions
diff --git a/std/Monad/State.bruijn b/std/Monad/State.bruijn
index 8a7ef25..6cf6019 100644
--- a/std/Monad/State.bruijn
+++ b/std/Monad/State.bruijn
@@ -11,3 +11,8 @@ map [[[1 0 [[[0 2 (5 1)]]]]]] ⧗ (a → b) → (State s a) → (State s b)
bind [[[2 0 [[3 0 1]]]]] ⧗ (State s a) → (a → (State s b)) → (State s b)
…>>=… bind
+
+pure [[[0 2 1]]] ⧗ a → (State s a)
+
+:test ((w' ∘ c) >>= [(w' ∘ c) >>= [pure 0]] [[0]]) (w' [[0]])
+:test ((w' ∘ c) >>= [(w' ∘ c) >>= [pure 0]] [[1]]) (w' [[1]])