multi-line grep - Haskell version