Created
October 5, 2017 16:07
-
-
Save hanshoglund/712eddfb95262e0b47655dcc68b77d59 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
data Moore a b = forall r . Moore (r -> b) (r -> a -> r) r | |
data Moore2 a b = Moore2 b (a -> Moore2 a b) | |
l :: Moore2 a b -> Moore a b | |
l machine = L (\(Moore2 state _) -> state) (\(Moore2 _ step) input -> step input) machine | |
r :: Moore a n -> Moore2 a b | |
r (Moore view step state) = Moore2 (view state) (\input -> r $ Moore view step $ step state input) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment