28699c95a7
There are still hundreds of places that use partial functions head, tail, init, and last.
24 lines
494 B
Haskell
24 lines
494 B
Haskell
{- 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
|