Created
September 12, 2013 15:28
-
-
Save qoelet/6539436 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
-- determine if function f is even or odd | |
even_f :: (Eq a,Num a) => (a -> a) -> a -> Bool | |
even_f f x | f x == f (-x) = True | |
| otherwise = False | |
odd_f :: (Eq a, Num a) => (a -> a) -> a -> Bool | |
odd_f f x | (-(f x)) == f (-x) = True | |
| otherwise = False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment