-
-
Save dminuoso/ac6d72cf8d83d96b84ecdc23ed44cae2 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 Store s a = Store (s -> a) s | |
-- Read out the store at some specific position | |
peek :: s -> Store s a -> a | |
peek = _ | |
-- Modify the current focus, and read the store using the new focus. | |
peeks :: (s -> s) -> Store s a -> a | |
peeks = _ | |
-- Set the current focus | |
seek :: s -> Store s a -> Store s a | |
seek = _ | |
-- Modify the current focus | |
seeks :: (s -> s) -> Store s a -> Store s a | |
seeks = _ | |
-- Run an experiment in the store. | |
experiment :: Functor f => (s -> f s) -> Store s a -> f a | |
experiment = _ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment