indirectToDirect :: IndirectDfa a -> DirectDfa a
indirectToDirect (start, states)
  = tieArray ! start
    where
        tieArray = array (0,length states - 1)
                        [ (i,direct s) | (i,s) <- zip [0..] states ]
 
        direct (IndirectState final trans)
          = DirectState final [ (x, tieArray ! s) | (x,s) <- trans ]
indirectToDirect :: IndirectDfa a -> DirectDfa a
indirectToDirect (start, states)
  = tieArray ! start
    where
        tieArray = array (0,length states - 1)
                        [ (i,direct s) | (i,s) <- zip [0..] states ]
 
        direct (IndirectState final trans)
          = DirectState final [ (x, tieArray ! s) | (x,s) <- trans ]
indirectToDirect (start, states)
  = tieArray ! start
    where
        tieArray = array (0,length states - 1)
                        [ (i,direct s) | (i,s) <- zip [0..] states ]
 
        direct (IndirectState final trans)
          = DirectState final [ (x, tieArray ! s) | (x,s) <- trans ]