diff options
Diffstat (limited to 'H1.hs')
-rw-r--r-- | H1.hs | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -0,0 +1,9 @@ + +myLast :: [a] -> a +myLast [] = error "Empty List" +myLast [x] = x +myLast (x:xs) = myLast xs + +myLast' = foldl1 (flip const) + +myLast'' = foldl1 (curry snd) |