Merge in mutual recursion handling

This commit is contained in:
sebastianselander 2023-03-31 18:28:04 +02:00
parent b7420b5adb
commit 0749ca062d
3 changed files with 81 additions and 98 deletions

View file

@ -188,6 +188,11 @@ instance Print t => Print (Inj' t) where
prt i = \case
Inj uident type_ -> prPrec i 0 (concatD [prt 0 uident, doc (showString ":"), prt 0 type_])
instance Print t => Print [Inj' t] where
prt _ [] = concatD []
prt i [x] = prt i x
prt i (x : xs) = prPrec i 0 $ concatD [prt i x, doc $ showString "\n ", prt i xs]
instance Print t => Print (Pattern' t) where
prt i = \case
PVar name -> prPrec i 1 (concatD [prt 0 name])