diff options
author | Joey Hess <joey@kitenet.net> | 2011-12-15 22:19:05 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-12-15 22:19:05 -0400 |
commit | 718a278f973e8005ce4ba76717218abcabe5d0b1 (patch) | |
tree | 851207fbfc9e730c5c9ed6500d69b4d64f500514 /Utility | |
parent | 9901fc04a0dd9972e8910b5039a9e51e43d2c732 (diff) |
simplify
Diffstat (limited to 'Utility')
-rw-r--r-- | Utility/BadPrelude.hs | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/Utility/BadPrelude.hs b/Utility/BadPrelude.hs index 825adfa02..04c9d9b0b 100644 --- a/Utility/BadPrelude.hs +++ b/Utility/BadPrelude.hs @@ -56,16 +56,9 @@ lastMaybe v = Just $ Prelude.last v - (Like init, but no error on an empty list.) -} beginning :: [a] -> [a] beginning [] = [] -beginning (x:xs) = beginning' x xs - where - beginning' _ [] = [] - beginning' y (z:zs) = y : beginning' z zs +beginning l = Prelude.init l {- Like last, but no error on an empty list. -} end :: [a] -> [a] end [] = [] -end (x:xs) = end' x xs - where - end' y [] = [y] - end' _ (y:ys) = end' y ys - +end l = [Prelude.last l] |