In examples I've observed dropWhile's behavior:
*Main> dropWhile (/= 'X') "AXF"
"XF"
But, I'm confused why "AX" does not return:
*Main> dropWhile (== 'X') "AXF"
"AXF"
Why does "AXF" return in this test?
dropWhile drops elements while the condition is true and then stops (returning the remaining elements) once the condition is false.
With dropWhile (== 'X') "AXF" the condition is false right away (because 'A' == 'X' is false), so it doesn't drop anything and returns the whole list.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With