aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--algebraic-structs.monad.make.scm7
1 files changed, 5 insertions, 2 deletions
diff --git a/algebraic-structs.monad.make.scm b/algebraic-structs.monad.make.scm
index e7c8774..70ead19 100644
--- a/algebraic-structs.monad.make.scm
+++ b/algebraic-structs.monad.make.scm
@@ -14,11 +14,14 @@
(foldr (lambda (binding acc)
(match binding
[(var stx expr)
- (if (and (symbol? stx) (compare stx '<-))
+ (if (and (symbol? var)
+ (symbol? stx)
+ (compare stx '<-))
`(>>= ,expr (lambda (,var) ,acc))
`(>>= ,binding (lambda (_) ,acc)))]
[(let-stx var =-stx expr)
- (cond ((and (symbol? let-stx) (compare let-stx (inject 'let))
+ (cond ((and (symbol? var)
+ (symbol? let-stx) (compare let-stx (inject 'let))
(symbol? =-stx) (compare =-stx (inject '=)))
`((lambda (,var) ,acc) ,expr))
(else