Created
October 31, 2016 04:30
-
-
Save kaveet/6cab6fe7e494b61470870f45a7c2d60f to your computer and use it in GitHub Desktop.
Haskell Safetail Implementations
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
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