summaryrefslogtreecommitdiff
path: root/Utility/BadPrelude.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Utility/BadPrelude.hs')
-rw-r--r--Utility/BadPrelude.hs28
1 files changed, 28 insertions, 0 deletions
diff --git a/Utility/BadPrelude.hs b/Utility/BadPrelude.hs
new file mode 100644
index 000000000..7921a7e9b
--- /dev/null
+++ b/Utility/BadPrelude.hs
@@ -0,0 +1,28 @@
+{- Some stuff from Prelude should not be used, as it tends to be a source
+ - of bugs.
+ -
+ - This exports functions that conflict with the prelude, which avoids
+ - them being accidentially used.
+ -}
+
+module Utility.BadPrelude where
+
+{- head is a partial function; head [] is an error -}
+head :: [a] -> a
+head = Prelude.head
+
+{- tail is also partial -}
+tail :: [a] -> a
+tail = Prelude.tail
+
+{- init too -}
+init :: [a] -> a
+init = Prelude.init
+
+{- last too -}
+last :: [a] -> a
+last = Prelude.last
+
+{- read should be avoided, as it throws an error -}
+read :: Read a => String -> a
+read = Prelude.read