Skip to content

Instantly share code, notes, and snippets.

@eklitzke
Created June 28, 2009 03:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eklitzke/137194 to your computer and use it in GitHub Desktop.
Save eklitzke/137194 to your computer and use it in GitHub Desktop.
type Ctx = Map String Double
fetch :: Ctx -> String -> Double
fetch = fromJust . lookup
data Orbit = Orbit IORef Position Velocity
class AltStrategy s where
impulse :: s -> Ctx -> Orbit -> IO (Ctx, Double, Double)
isDone :: s -> OuputPorts -> Bool
isDone _ ports = (fromJust $ lookup 0 ports) /= 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment