summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Zhao <ztuowen@gmail.com>2015-01-29 15:56:05 +0800
committerJoe Zhao <ztuowen@gmail.com>2015-01-29 15:56:05 +0800
commitedcc6ba8ca9d6b883b59548eb8bb5e312c73f43b (patch)
tree1781953c44d242c5a64a71dcfbf7ab14e00fa802
downloadh99-edcc6ba8ca9d6b883b59548eb8bb5e312c73f43b.tar.gz
h99-edcc6ba8ca9d6b883b59548eb8bb5e312c73f43b.tar.bz2
h99-edcc6ba8ca9d6b883b59548eb8bb5e312c73f43b.zip
p1
-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