Skip to content

Instantly share code, notes, and snippets.

@kaveet
Created October 31, 2016 04:30
Show Gist options
  • Save kaveet/6cab6fe7e494b61470870f45a7c2d60f to your computer and use it in GitHub Desktop.
Save kaveet/6cab6fe7e494b61470870f45a7c2d60f to your computer and use it in GitHub Desktop.
Haskell Safetail Implementations
module Safetails where
safetail :: Eq a => [a] -> [a]
safetail xs = if xs == [] then [] else tail xs
safetail' :: Eq a => [a] -> [a]
safetail' xs
| xs == [] = []
| otherwise = tail xs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment