diff options
Diffstat (limited to '')
-rw-r--r-- | monad/stack.scm | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/monad/stack.scm b/monad/stack.scm index 8d25303..fee48a6 100644 --- a/monad/stack.scm +++ b/monad/stack.scm @@ -1,14 +1,15 @@ +;;; Commentary: +;; Simple stateful stack module for showing the state monad +;; in action. These functions assume that they are in a +;; (state list) monad. But dynamic types! +;; +;; TODO test these for empty stack +;;; Code: (define-module (monad stack) #:export (pop peek push) #:use-module (monad) #:use-module (monad state)) -;;; Simple stateful stack module for showing the state monad -;;; 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) |