PCRE style regular expression matching using partial derivatives in Haskell