DFARule a b]
genDFARule' (D.State s) rs = L.map nxt matchedRules
  where
    matchedRules :: [ENFARule a b] 
    matchedRules = L.filter (\(Rule (D.State x) y _) -> case y of
                                                          (Right _) -> False
                                                          (Left _) -> (member x s)) rs
    nxt ::  ENFARule a b -> DFARule a b
    nxt (Rule (D.State f) (Left i) t) = D.Rule (D.State s) i (D.State (fromList (L.map (\(D.State x) -> x) (eclose [t] rs))))
    nxt (Rule _ (Right Epsilon) t) = error "Can't convert epsilon rule to dfa-rule. (Illigal state)"

genDFARule'' :: forall a b. (Ord a) => [ENFARule a b] -> [DFARule a b] -> [D
genDFARule' :: forall a b. (Ord a) => (D.State (Set a)) -> [ENFARule a b] -> [DFARule a b]
genDFARule' (D.State s) rs = L.map nxt matchedRules
  where
    matchedRules :: [ENFARule a b] 
    matchedRules = L.filter (\(Rule (D.State x) y _) -> case y of
                                                          (Right _) -> False
                                                          (Left _) -> (member x s)) rs
    nxt ::  ENFARule a b -> DFARule a b
    nxt (Rule (D.State f) (Left i) t) = D.Rule (D.State s) i (D.State (fromList (L.map (\(D.State x) -> x) (eclose [t] rs))))
    nxt (Rule _ (Right Epsilon) t) = error "Can't convert epsilon rule to dfa-rule. (Illigal state)"
genDFARule' (D.State s) rs = L.map nxt matchedRules
  where
    matchedRules :: [ENFARule a b] 
    matchedRules = L.filter (\(Rule (D.State x) y _) -> case y of
                                                          (Right _) -> False
                                                          (Left _) -> (member x s)) rs
    nxt ::  ENFARule a b -> DFARule a b
    nxt (Rule (D.State f) (Left i) t) = D.Rule (D.State s) i (D.State (fromList (L.map (\(D.State x) -> x) (eclose [t] rs))))
    nxt (Rule _ (Right Epsilon) t) = error "Can't convert epsilon rule to dfa-rule. (Illigal state)"