From 4b38d1af08288e80a29c84fe02a40ac925331f21 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 27 Nov 2024 15:16:11 +0100 Subject: Monad improvements --- std/Monad/State.bruijn | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'std/Monad/State.bruijn') 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]]) -- cgit v1.2.3