Created
July 9, 2017 00:55
-
-
Save kunigami/a00b7a21b7572d5bb5b49d1e271c52ee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
Execute (evaluate) the first item of the schedule. If the first digit of | |
the item is Zero, we re-schedule the rest of the digits. If it's a One, it | |
means that the remaining digits have been executed, so we just discard it. | |
*) | |
let execSchedule | |
(schedule: digit stream list) | |
: digit stream list = match schedule with | |
| [] -> [] | |
| firstItem :: rest -> match firstItem with | |
| lazy (StreamCell (Zero, job)) -> job :: rest | |
| _ -> rest | |
;; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment