aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2019-03-18 23:18:19 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2019-03-18 23:18:19 +0100
commitd6c7a20b9895653d3ab24a1776781cdfe18ccf4b (patch)
treee73c170c539630c07b13aaeb6ca98f7644d702a3
parentRewrote writer monad. (diff)
downloadscheme-monad-d6c7a20b9895653d3ab24a1776781cdfe18ccf4b.tar.gz
scheme-monad-d6c7a20b9895653d3ab24a1776781cdfe18ccf4b.tar.xz
Removed monoid class.
-rw-r--r--monad/monoid.scm26
1 files changed, 0 insertions, 26 deletions
diff --git a/monad/monoid.scm b/monad/monoid.scm
deleted file mode 100644
index 4b10a72..0000000
--- a/monad/monoid.scm
+++ /dev/null
@@ -1,26 +0,0 @@
-;;; ???
-(define-module (monad monoid)
- #:use-module (oop goops)
- #:use-module (srfi srfi-1)
- #:export (null mappend <>))
-
-(define-generic null)
-(define-generic mappend)
-
-(define (<> . args)
- (fold mappend (null (car args)) (reverse args)))
-
-;;; Lists
-
-(define-method (mappend (a <pair>) (b <pair>))
- (append a b))
-(define-method (mappend (a <pair>) (b <null>)) a)
-(define-method (mappend (a <null>) (b <pair>)) b)
-(define-method (mappend (a <null>) (b <null>)) '())
-(define-method (null (a <pair>)) '())
-(define-method (null (a <null>)) '())
-
-;;; Strings
-(define-method (mappend (a <string>) (b <string>))
- (string-append a b))
-(define-method (null (a <string>)) "")