Skip to content

Instantly share code, notes, and snippets.

@AndreaCrotti
Created November 24, 2009 13:04
Show Gist options
  • Save AndreaCrotti/241861 to your computer and use it in GitHub Desktop.
Save AndreaCrotti/241861 to your computer and use it in GitHub Desktop.
eval2 :: Term -> MyMaybe2 Float
eval2 (Log x) = do
y <- eval2 x
if y <= 0
then Error2 ("Cannot take logarithm of non-positive number " ++ show y ++ "!")
else return $ log y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment