Skip to content

Instantly share code, notes, and snippets.

@eklitzke
Created June 27, 2009 23:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save eklitzke/137149 to your computer and use it in GitHub Desktop.
Save eklitzke/137149 to your computer and use it in GitHub Desktop.
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