Use 'dropWhileEnd' and 'takeWhileEnd'.

'[drop,take]WhileEnd p' is semantically the same as 'reverse . [drop,take]While
p . reverse', but more efficient and easier to read.
Use 'Char.isDigit' where appropriate.