summaryrefslogtreecommitdiff
path: root/Utility/BadPrelude.hs
blob: 8e4105ceeafdb4475878994183327b22b8068bf8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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