Use drop 1 instead of reimplementing it in terms of tail

This commit is contained in:
Joseph C. Sible
2019-12-14 23:43:31 -05:00
committed by GitHub
parent 52f8c82504
commit 5860864e45

View File

@@ -126,11 +126,9 @@ getCommands = do
split :: Eq a => a -> [a] -> [[a]]
split _ [] = []
split e l =
f : split e (rest ls)
f : split e (drop 1 ls)
where
(f,ls) = span (/=e) l
rest s | s == [] = []
| otherwise = tail s
escape :: String -> String
escape [] = ""