dropWhileEnd package:rio

The dropWhileEnd function drops the largest suffix of a list in which the given predicate holds for all elements. For example:
>>> dropWhileEnd isSpace "foo\n"
"foo"
>>> dropWhileEnd isSpace "foo bar"
"foo bar"
dropWhileEnd isSpace ("foo\n" ++ undefined) == "foo" ++ undefined
O(n) dropWhileEnd p t returns the prefix remaining after dropping characters that satisfy the predicate p from the end of t. Subject to fusion. Examples:
>>> dropWhileEnd (=='.') "foo..."
"foo"
O(n) dropWhileEnd p t returns the prefix remaining after dropping characters that satisfy the predicate p from the end of t. Examples:
dropWhileEnd (=='.') "foo..." == "foo"