eclose'' s rs acc
  | epNexts == [] = acc
  | otherwise = eclose'' s rs (acc ++ epNexts)
  where
    epNexts = L.filter (\es -> not (elem es acc)) $ 
                concat $ L.map (\a -> eclose' a rs) acc

eclose :: (Eq a) => [D.State a] -> [Rule a b] -> [D.State a]
eclose s rs = e
eclose'' :: (Eq a) => [D.State a] -> [Rule a b] -> [D.State a] -> [D.State a]
eclose'' s rs acc
  | epNexts == [] = acc
  | otherwise = eclose'' s rs (acc ++ epNexts)
  where
    epNexts = L.filter (\es -> not (elem es acc)) $ 
                concat $ L.map (\a -> eclose' a rs) acc
eclose'' s rs acc
  | epNexts == [] = acc
  | otherwise = eclose'' s rs (acc ++ epNexts)
  where
    epNexts = L.filter (\es -> not (elem es acc)) $ 
                concat $ L.map (\a -> eclose' a rs) acc