summaryrefslogtreecommitdiff
path: root/p1.hs
diff options
context:
space:
mode:
Diffstat (limited to 'p1.hs')
-rw-r--r--p1.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/p1.hs b/p1.hs
new file mode 100644
index 0000000..3afd512
--- /dev/null
+++ b/p1.hs
@@ -0,0 +1,5 @@
+
+myLast :: [a] -> a
+myLast [] = error "Empty List"
+myLast [x] = x
+myLast (x:xs) = myLast xs