aboutsummaryrefslogtreecommitdiff
path: root/data/either.scm
diff options
context:
space:
mode:
Diffstat (limited to 'data/either.scm')
-rw-r--r--data/either.scm30
1 files changed, 0 insertions, 30 deletions
diff --git a/data/either.scm b/data/either.scm
deleted file mode 100644
index c597a60..0000000
--- a/data/either.scm
+++ /dev/null
@@ -1,30 +0,0 @@
-;;; TODO UNFINISHED
-
-(define-module (data either)
- #:use-module (oop goops)
- #:use-module (ice-9 match))
-
-(define-class <either> ()
- (slot #:init-keyword #:slot)
- (dir #:init-keyword #:dir #:init-value 'left))
-
-(define (left val)
- "Error values"
- (make <either> #:slot val #:dir 'left))
-
-(define (right val)
- "Good values"
- (make <either> #:slot val #:dir 'right))
-
-(define-method (write (this <either>) port)
- (format port "[~a ~s]"
- (slot-ref this 'dir)
- (slot-ref this 'slot)))
-
-(define-method (>>= (this <either>)
- (proc <procedure>))
- (case (slot-ref this 'dir)
- ((left) this)
- ((right) (match this (($ <either> slot) (proc slot))))))
-
-(define return-either right)