aboutsummaryrefslogtreecommitdiff
path: root/algebraic-structs.alternative.make.scm
diff options
context:
space:
mode:
authorMasaya Tojo <masaya@tojo.tokyo>2024-06-09 05:13:44 +0900
committerMasaya Tojo <masaya@tojo.tokyo>2024-06-09 05:13:44 +0900
commit92eeab2815eae6cd9ef22530d2e50fe0a620ec46 (patch)
tree8bfdca868c360846829f7582e12ab77ce843b8eb /algebraic-structs.alternative.make.scm
Initial commit
Diffstat (limited to 'algebraic-structs.alternative.make.scm')
-rw-r--r--algebraic-structs.alternative.make.scm10
1 files changed, 10 insertions, 0 deletions
diff --git a/algebraic-structs.alternative.make.scm b/algebraic-structs.alternative.make.scm
new file mode 100644
index 0000000..df4e0f4
--- /dev/null
+++ b/algebraic-structs.alternative.make.scm
@@ -0,0 +1,10 @@
+(functor ((algebraic-structs alternative make) (A (pure map map2 alt empty)))
+ (pure map map2 alt empty guard)
+ (import (except scheme map apply)
+ (only (chicken base) void)
+ A)
+
+ (define (guard b)
+ (if b
+ (pure (void))
+ empty)))