Skip to content

Instantly share code, notes, and snippets.

@barik
Created May 16, 2011 11:52
Show Gist options
  • Save barik/974314 to your computer and use it in GitHub Desktop.
Save barik/974314 to your computer and use it in GitHub Desktop.
Haskell Example
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