more partial function removal
Left a few Prelude.head's in where it was checked not null and too hard to remove, etc.
This commit is contained in:
parent
b7e0d39abb
commit
95d2391f58
24 changed files with 73 additions and 78 deletions
|
@ -73,14 +73,13 @@ configUnEscape = unescape
|
|||
| c == '&' = entity rest
|
||||
| otherwise = c : unescape rest
|
||||
entity s = if ok
|
||||
then chr (read num) : unescape rest
|
||||
then chr (Prelude.read num) : unescape rest
|
||||
else '&' : unescape s
|
||||
where
|
||||
num = takeWhile isNumber s
|
||||
r = drop (length num) s
|
||||
rest = drop 1 r
|
||||
ok = not (null num) &&
|
||||
not (null r) && head r == ';'
|
||||
ok = not (null num) && take 1 r == ";"
|
||||
|
||||
{- for quickcheck -}
|
||||
prop_idempotent_configEscape :: String -> Bool
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue