aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasaya Tojo <masaya@tojo.tokyo>2024-06-16 13:06:25 +0900
committerMasaya Tojo <masaya@tojo.tokyo>2024-06-16 13:06:25 +0900
commitded31df310122b0252c69bff90b915c3e5b0ad20 (patch)
tree5ffd24246e4d45f7200d5398b2c27ec44ae732c8
parente51a5f32bb8f23eb0fd27213cb36ce09a42a6386 (diff)
Use `receive` syntax in `do` syntax
-rw-r--r--algebraic-structures.monad.scm5
1 files changed, 3 insertions, 2 deletions
diff --git a/algebraic-structures.monad.scm b/algebraic-structures.monad.scm
index dd9b850..8e906e3 100644
--- a/algebraic-structures.monad.scm
+++ b/algebraic-structures.monad.scm
@@ -4,6 +4,7 @@
(apply scheme:apply)
(map scheme:map)
(do scheme:do))
+ (chicken base)
M)
(import-for-syntax matchable
(chicken syntax)
@@ -31,8 +32,8 @@
(every symbol? var)
(symbol? let-stx) (compare let-stx (inject 'let-values))
(symbol? =-stx) (compare =-stx (inject '=)))
- `(call-with-values (lambda () ,expr)
- (lambda ,var ,acc)))
+ `(receive ,var ,expr
+ ,acc))
(else
`(>>= ,binding (lambda (_) ,acc))))]
[expr