From b2b25c692679dda42cd9f26e472707c7e3ae04f9 Mon Sep 17 00:00:00 2001 From: bryanedds Date: Sun, 4 Jan 2015 10:54:33 -0500 Subject: [PATCH] Bit of code clean-up. Former-commit-id: 73ad03acad23d1ff4445cfb1db40f0b838196214 --- Nu/Nu/Nu/Desync.fs | 2 +- Prime/Prime/Prime/Desync.fs | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Nu/Nu/Nu/Desync.fs b/Nu/Nu/Nu/Desync.fs index fd18784902..97b5212187 100644 --- a/Nu/Nu/Nu/Desync.fs +++ b/Nu/Nu/Nu/Desync.fs @@ -97,7 +97,7 @@ module Desync = World.unsubscribe subscriptionKey world let advance = fun event world -> let desync = World.getCallbackState callbackKey world : Event<'a, 'o> -> Desync, World, unit> - let (world, advanceResult) = advance desync event world + let (world, advanceResult) = advanceDesync desync event world match advanceResult with | Right () -> unsubscribe world | Left desyncNext -> World.addCallbackState callbackKey desyncNext world diff --git a/Prime/Prime/Prime/Desync.fs b/Prime/Prime/Prime/Desync.fs index 1b73bfbc11..9c0eedf323 100644 --- a/Prime/Prime/Prime/Desync.fs +++ b/Prime/Prime/Prime/Desync.fs @@ -98,16 +98,16 @@ module Desync = let during (pred : 's -> bool) (m : Desync<'e, 's, unit>) = loop () id (fun _ -> pred) (fun _ -> m) - /// TODO: document. + /// Step once into a desync. let step (m : Desync<'e, 's, 'a>) (s : 's) : 's * Either<'e -> Desync<'e, 's, 'a>, 'a> = match m with Desync f -> f s - /// Advance a desync value by one step. - let advance (m : 'e -> Desync<'e, 's, 'a>) (e : 'e) (s : 's) : 's * Either<'e -> Desync<'e, 's, 'a>, 'a> = + /// Advance a desync value by one step with the given event 'e'. + let advanceDesync (m : 'e -> Desync<'e, 's, 'a>) (e : 'e) (s : 's) : 's * Either<'e -> Desync<'e, 's, 'a>, 'a> = step (m e) s - - /// TODO: document. - let rec run (m : Desync<'e, 's, 'a>) (e : 'e) (s : 's) : ('s * 'a) = + + /// Run a desync to its end, providing the event 'e' for all its steps. + let rec runDesync (m : Desync<'e, 's, 'a>) (e : 'e) (s : 's) : ('s * 'a) = match step m s with - | (s', Left m') -> run (m' e) e s' + | (s', Left m') -> runDesync (m' e) e s' | (s', Right v) -> (s', v) \ No newline at end of file