I am confused on the implementation of (\\)
From the Haskell Online Report we have:
(\\) :: Eq a => [a] -> [a] -> [a]
(\\) = foldl (flip delete)
(flip delete) changes the type signature to the following:
*Main> :t (flip delete)
forall a. (Eq a) => [a] -> a -> [a]
foldl usually is obvious: it folds the list from the left, or the beginning. Meaning, it takes the seed element and the first element of the list and produces a result. This result is the new seed to be used with the next element of the list and so on until a result is produced.
But what is the flipped version of foldl doing in this case? It receives an entire list in the position it normally just receives an element.