From b4ac0fa66a3212fad3373a68d84d4b74c5fd309c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 18 Mar 2019 21:57:47 +0100 Subject: Wrote a bunch of documentation. --- monad/stack.scm | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'monad/stack.scm') 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) -- cgit v1.2.3