mirror of
https://github.com/correl/calrissian.git
synced 2024-11-23 19:19:57 +00:00
Fix state-transformer:modify-and-return
The method was returning a single value, rather than the necessary tuple required for binding to work.
This commit is contained in:
parent
d399492679
commit
76ffe600ef
1 changed files with 2 additions and 2 deletions
|
@ -1,5 +1,4 @@
|
||||||
(defmodule state-transformer
|
(defmodule state-transformer
|
||||||
(behaviour monad)
|
|
||||||
(export all))
|
(export all))
|
||||||
|
|
||||||
(include-lib "include/monads.lfe")
|
(include-lib "include/monads.lfe")
|
||||||
|
@ -38,7 +37,8 @@
|
||||||
(defun modify-and-return
|
(defun modify-and-return
|
||||||
((f (tuple 'state-transformer inner-monad))
|
((f (tuple 'state-transformer inner-monad))
|
||||||
(lambda (s)
|
(lambda (s)
|
||||||
(call inner-monad 'return (funcall f s)))))
|
(let ((newstate (call inner-monad 'return (funcall f s))))
|
||||||
|
(tuple newstate newstate)))))
|
||||||
|
|
||||||
(defun eval
|
(defun eval
|
||||||
((m s (tuple 'state-transformer inner-monad))
|
((m s (tuple 'state-transformer inner-monad))
|
||||||
|
|
Loading…
Reference in a new issue