From 76ffe600efbbae3d73b47191de0868cfe3977192 Mon Sep 17 00:00:00 2001 From: Correl Roush Date: Wed, 9 Jul 2014 01:33:45 -0400 Subject: [PATCH] Fix state-transformer:modify-and-return The method was returning a single value, rather than the necessary tuple required for binding to work. --- src/state-transformer.lfe | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/state-transformer.lfe b/src/state-transformer.lfe index e636f06..6816a2d 100644 --- a/src/state-transformer.lfe +++ b/src/state-transformer.lfe @@ -1,5 +1,4 @@ (defmodule state-transformer - (behaviour monad) (export all)) (include-lib "include/monads.lfe") @@ -38,7 +37,8 @@ (defun modify-and-return ((f (tuple 'state-transformer inner-monad)) (lambda (s) - (call inner-monad 'return (funcall f s))))) + (let ((newstate (call inner-monad 'return (funcall f s)))) + (tuple newstate newstate))))) (defun eval ((m s (tuple 'state-transformer inner-monad))