Skip to content

Instantly share code, notes, and snippets.

@szmeku
Created May 18, 2015 14:17
Show Gist options
  • Save szmeku/2c28b0a2101dcbd3a937 to your computer and use it in GitHub Desktop.
Save szmeku/2c28b0a2101dcbd3a937 to your computer and use it in GitHub Desktop.
max [] = error "cannot get max from empty list"
max [x] = x
max (head:tail)
| head > max tail = head
| otherwise = max tail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment