aboutsummaryrefslogtreecommitdiff
path: root/monad/stack.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2019-03-18 21:57:47 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2019-03-18 21:57:47 +0100
commitb4ac0fa66a3212fad3373a68d84d4b74c5fd309c (patch)
treeaecf6d89f36849e5efb999315c38d572cbbed48e /monad/stack.scm
parentRemove entire examples directory. (diff)
downloadscheme-monad-b4ac0fa66a3212fad3373a68d84d4b74c5fd309c.tar.gz
scheme-monad-b4ac0fa66a3212fad3373a68d84d4b74c5fd309c.tar.xz
Wrote a bunch of documentation.
Diffstat (limited to 'monad/stack.scm')
-rw-r--r--monad/stack.scm13
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)