Skip to content

Commit 8a416d9

Browse files
committed
compress ppr tree
1 parent 872cfec commit 8a416d9

File tree

1 file changed

+6
-1
lines changed
  • plugins/tactics/src/Ide/Plugin/Tactic

1 file changed

+6
-1
lines changed

plugins/tactics/src/Ide/Plugin/Tactic/Types.hs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,12 @@ newtype Rose a = Rose (Tree a)
202202
deriving stock (Eq, Functor, Generic)
203203

204204
instance Show (Rose String) where
205-
show = drawTree . coerce
205+
show = unlines . dropEveryOther . lines . drawTree . coerce
206+
207+
dropEveryOther :: [a] -> [a]
208+
dropEveryOther [] = []
209+
dropEveryOther [a] = [a]
210+
dropEveryOther (a : _ : as) = a : dropEveryOther as
206211

207212
instance Semigroup a => Semigroup (Rose a) where
208213
Rose (Node a as) <> Rose (Node b bs) = Rose $ Node (a <> b) (as <> bs)

0 commit comments

Comments
 (0)