logic/Logic/Language.hs
2025-08-10 09:17:00 +00:00

15 lines
603 B
Haskell

module Logic.Language where
-- Formal language (/grammar/production system/whatever)
class (Eq symbol, Show symbol) => Language symbol where
-- If Haskell had dependent types this could be generalized.
-- For now the languages I want to make use at most up to infer3.
infer0 :: [[symbol]]
infer1 :: [[symbol] -> [[symbol]]]
infer2 :: [[symbol] -> [symbol] -> [[symbol]]]
infer3 :: [[symbol] -> [symbol] -> [symbol] -> [[symbol]]]
-- Convenience newtype so strings are less ugly
newtype Seq symbol = Seq [symbol]
instance Show a => Show (Seq a) where
show (Seq xs) = concat $ map show xs