Implementing a NFA in Haskell.