Extending propositional logic to modal logic in Haskell
问题 I have written some code in Haskell for modeling propositional logic data Formula = Prop {propName :: String} | Neg Formula | Conj Formula Formula | Disj Formula Formula | Impl Formula Formula | BiImpl Formula Formula deriving (Eq,Ord) However, there is no natural way to extend this to Modal Logic, since the data type is closed. Therefore, I thought I should use classes instead. That way, I can easily add new language features in different modules later on. The problem is that I don't exactly