matchRule :: (Eq a) => D.Input b -> D.State a -> [Rule a b] -> [Rule a b]
matchRule (D.Input i) cs rs = 
    L.filter (\(Rule c y _) -> case y of
                                 (Left f) -> (cs == c) && (f i)
                                 (Right _) -> False) rs
matchRule :: (Eq a) => D.Input b -> D.State a -> [Rule a b] -> [Rule a b]
matchRule (D.Input i) cs rs = 
    L.filter (\(Rule c y _) -> case y of
                                 (Left f) -> (cs == c) && (f i)
                                 (Right _) -> False) rs
matchRule (D.Input i) cs rs = 
    L.filter (\(Rule c y _) -> case y of
                                 (Left f) -> (cs == c) && (f i)
                                 (Right _) -> False) rs