diff options
Diffstat (limited to '')
-rw-r--r-- | monad/monoid.scm | 26 |
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>)) "") |