summaryrefslogtreecommitdiff
path: root/src/Util.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Util.hs')
-rw-r--r--src/Util.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Util.hs b/src/Util.hs
new file mode 100644
index 0000000..15ca593
--- /dev/null
+++ b/src/Util.hs
@@ -0,0 +1,7 @@
+module Util (safeHead) where
+
+-- |Safe head function
+safeHead [] = Nothing
+safeHead (x:_) = Just x
+
+