Created
November 24, 2009 13:04
-
-
Save AndreaCrotti/241861 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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