A simple regex engine written in Haskell