Skip to content

Instantly share code, notes, and snippets.

@eklitzke
Created June 27, 2009 23:02
Show Gist options
  • 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 in loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment