Created
July 21, 2013 10:28
-
-
Save ChrisBuchholz/6048179 to your computer and use it in GitHub Desktop.
safeInit
This file contains hidden or 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
| safeInit :: [a] -> [a] | |
| safeInit (x:xs) | |
| | null xs = [] | |
| | otherwise = x : safeInit xs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Actual safe version: