From e41ade0f54d47ec3e07593f0763521aedc8ad390 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 18 Mar 2019 18:25:25 +0100 Subject: Assorted comments and cleanup. --- data/either.scm | 4 +++- data/monoid.scm | 1 + data/stack.scm | 3 +++ data/writer.scm | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) (limited to 'data') diff --git a/data/either.scm b/data/either.scm index d6e0f73..c597a60 100644 --- a/data/either.scm +++ b/data/either.scm @@ -1,3 +1,5 @@ +;;; TODO UNFINISHED + (define-module (data either) #:use-module (oop goops) #:use-module (ice-9 match)) @@ -22,7 +24,7 @@ (define-method (>>= (this ) (proc )) (case (slot-ref this 'dir) - ((left) this) + ((left) this) ((right) (match this (($ slot) (proc slot)))))) (define return-either right) diff --git a/data/monoid.scm b/data/monoid.scm index 45d30cd..d33557e 100644 --- a/data/monoid.scm +++ b/data/monoid.scm @@ -1,3 +1,4 @@ +;;; ??? (define-module (data monoid) #:use-module (oop goops) #:use-module (srfi srfi-1) diff --git a/data/stack.scm b/data/stack.scm index c28d648..d470394 100644 --- a/data/stack.scm +++ b/data/stack.scm @@ -1,4 +1,5 @@ (define-module (data stack) + #:export (pop peek push) #:use-module (control monad) #:use-module (control monad state)) @@ -6,6 +7,8 @@ ;;; in action. These functions assume that they are in a ;;; (state list) monad. But dynamic types! +;;; TODO test these for empty stack + (define (pop) (do st <- (get) let top = (car st) diff --git a/data/writer.scm b/data/writer.scm index 93f3798..bf391c2 100644 --- a/data/writer.scm +++ b/data/writer.scm @@ -30,6 +30,7 @@ (writer val (<> monoid-a monoid-b)) ))))) +;;; TODO replace this (define (return-writer val) (writer val "")) -- cgit v1.2.3