add Haskell version of nfa