on master help sign in
Merge pull request #1188 from david-christiansen/pprint

Show let bindings with proper line breaks and indentation in prover

commit8d0258820932dbc94456ad1f8dcc4ecba85d75d4 authorDavid Christiansen <david@davidchristiansen.dk> dateSun 4 May 2014, 23:20 (12 years ago) parent2ae48508e55b64
1 file changed+4−3
src/Idris/Prover.hs+4−3
src/Idris/Prover.hs+4−3
@@ -122,10 +122,11 @@ dumpState ist ps@(PS nm (h:hs) _ _ tm _ _ _ _ _ _ problems i _ _ ctxy _ _ _ _) =
122122 prettyPs bnd ((n@(MN _ r), _) : bs)
123123 | r == txt "rewrite_rule" = prettyPs ((n, False):bnd) bs
124124 prettyPs bnd ((n, Let t v) : bs) =
125− nest nestingSize (bindingOf n False <+> text "=" <+> tPretty bnd v <> colon <+>
126− tPretty ((n, False):bnd) t <> line <> prettyPs ((n, False):bnd) bs)
125+ line <> bindingOf n False <+> text "=" <+> tPretty bnd v <+> colon <+>
126+ align (tPretty bnd t) <> prettyPs ((n, False):bnd) bs
127127 prettyPs bnd ((n, b) : bs) =
128− line <> bindingOf n False <+> colon <+> align (tPretty bnd (binderTy b)) <> prettyPs ((n, False):bnd) bs
128+ line <> bindingOf n False <+> colon <+>
129+ align (tPretty bnd (binderTy b)) <> prettyPs ((n, False):bnd) bs
129130
130131 prettyG bnd (Guess t v) = tPretty bnd t <+> text "=?=" <+> tPretty bnd v
131132 prettyG bnd b = tPretty bnd $ binderTy b