1
1
mirror of https://github.com/anoma/juvix.git synced 2025-01-07 16:22:14 +03:00

[pretty] group infix declaration with symbol definition

This commit is contained in:
Jan Mas Rovira 2022-02-03 23:59:40 +01:00
parent 4d14338c30
commit 7510cd2240

View File

@ -213,6 +213,9 @@ groupStatements = reverse . map reverse . uncurry cons . foldl' aux ([], [])
definesSymbol :: Symbol -> Statement 'Scoped -> Bool
definesSymbol n s = case s of
StatementTypeSignature sig -> n == S._nameConcrete (sigName sig)
StatementInductive InductiveDef{..} ->
n == S._nameConcrete inductiveName ||
elem n (map (S._nameConcrete . constructorName) inductiveConstructors)
_ -> False
ppStatements :: Members '[Reader Options] r => [Statement 'Scoped] -> Sem r (Doc Ann)