summaryrefslogtreecommitdiff
path: root/p1.hs
diff options
context:
space:
mode:
Diffstat (limited to 'p1.hs')
-rw-r--r--p1.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/p1.hs b/p1.hs
index 3afd512..f0216c2 100644
--- a/p1.hs
+++ b/p1.hs
@@ -3,3 +3,7 @@ myLast :: [a] -> a
myLast [] = error "Empty List"
myLast [x] = x
myLast (x:xs) = myLast xs
+
+myLast' = foldl1 (flip const)
+
+myLast'' = foldl1 (curry snd)