Created
May 16, 2011 11:52
-
-
Save barik/974314 to your computer and use it in GitHub Desktop.
Haskell Example
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
doubleMe x = x + x | |
doubleUs x y = doubleMe x + doubleMe y | |
doubleSmallNumber x = | |
if x > 100 | |
then x | |
else x * 2 | |
maximum' [] = error "Empty list" | |
maximum' [x] = x | |
maximum' (x:xs) | |
| x > maximum' xs = x | |
| otherwise = maximum' xs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment