This is for work (so a realworld problem) I have a few idea how tackle it but I though it make an interesting puzzle.
The problem is how given a list and a sublist of it given in a different order update the whole list so that the element of the sublsiy appear in the new order but the other elements stay in place.
Example f [1 2 3 45 6 7 8] [8 4 3] == [1 2 8 4 5 6 7 3]
?
Alternativley it can be (Eq a, Ord a) => [a] -> (a -> Bool) -> ([a] -> [a]) -> [a]
.