diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-03-18 18:43:51 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-03-18 18:43:51 +0100 |
commit | e650a80856edc1d1df1f163c3f84082455717fa0 (patch) | |
tree | 4848ad975d95f5765980980d0e10ed0752e553f9 /data/monoid.scm | |
parent | Assorted comments and cleanup. (diff) | |
download | scheme-monad-e650a80856edc1d1df1f163c3f84082455717fa0.tar.gz scheme-monad-e650a80856edc1d1df1f163c3f84082455717fa0.tar.xz |
Compleately redid file structure.
Diffstat (limited to 'data/monoid.scm')
-rw-r--r-- | data/monoid.scm | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/data/monoid.scm b/data/monoid.scm deleted file mode 100644 index d33557e..0000000 --- a/data/monoid.scm +++ /dev/null @@ -1,26 +0,0 @@ -;;; ??? -(define-module (data 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>)) "") |