Created
June 27, 2009 23:02
-
-
Save eklitzke/137149 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
class Strategy s where | |
store :: s -> Ports -> IO () | |
fetch :: s -> IO [Ports] | |
isDone :: Ports -> Bool | |
updatePorts :: Ports -> IO Ports | |
next :: s -> s | |
run :: Strategy s => s -> IO [Ports] | |
run world = let loop = do w' = next world | |
if isDone w' | |
then fetch w' | |
else loop w' in loop world |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment