Permit function to return #f in transition-bind

This commit is contained in:
Tony Garnock-Jones 2014-05-28 16:31:05 -04:00
parent 1a63a2c35d
commit 53d0a67e96
1 changed files with 3 additions and 2 deletions

View File

@ -100,8 +100,9 @@
(define (transition-bind k t0)
(match-define (transition state0 actions0) t0)
(match-define (transition state1 actions1) (k state0))
(transition state1 (cons actions0 actions1)))
(match (k state0)
[(transition state1 actions1) (transition state1 (cons actions0 actions1))]
[#f t0]))
(define (sequence-transitions t0 . steps)
(foldl transition-bind t0 steps))