Skip to content

Instantly share code, notes, and snippets.

@jaspervdj
Created May 21, 2011 14:54
Show Gist options
  • Save jaspervdj/984582 to your computer and use it in GitHub Desktop.
Save jaspervdj/984582 to your computer and use it in GitHub Desktop.
Example of a pure function which isn't a pure function
-- | A pure function that isn't. Or is it?
--
eMach :: Double
eMach = eMach' 1.0
where
eMach' i
| i' > 0 = eMach' i'
| otherwise = i
where
i' = i / 2.0
main :: IO ()
main = putStrLn $ show eMach
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment