Totally naive regex engine in Haskell