Created
December 8, 2012 03:08
-
-
Save techtangents/4238402 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
type Stepper v = StepperImpl v s | |
data StepperImpl v s = StepperImpl { | |
initial :: s, | |
next :: s -> (v -> s -> StepState v s) -> StepState v s -> StepState v s | |
} | |
data StepState v s = More v s | Done | |
step1 :: StepperImpl v s -> StepState v s | |
step1 k@(StepperImpl init _) = step k init | |
step :: StepperImpl v s -> s -> StepState v s | |
step (StepperImpl _ n) = f s More Done | |
data StepperRun v s = StepperRun (StepperImpl v s) (StepState v s) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment