Skip to content

Commit

Permalink
use vsep instead of vcat
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximilianAlgehed committed May 6, 2024
1 parent d1fda42 commit 17d8417
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions libs/constrained-generators/src/Constrained/Base.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,7 @@ genFromPreds (optimisePred . optimisePred -> preds) = explain [show $ "genFromPr
go env [] = pure env
go env ((Name v, ps) : nps) = do
let ps' = substPred env <$> ps
spec <- runGE $ explain [show $ "Computing specs for:" /> vcat (map pretty ps')] $ do
spec <- runGE $ explain [show $ "Computing specs for:" /> vsep (map pretty ps')] $ do
specs <- mapM (computeSpec v) ps'
pure $ fold specs
val <- genFromSpec spec
Expand Down Expand Up @@ -1048,7 +1048,7 @@ linearize preds graph = do
fatalError $
[ show $
"linearize: Dependency cycle in graph:"
/> vcat
/> vsep
[ "cycle:" /> pretty cycle
, "graph:" /> pretty graph
]
Expand All @@ -1075,7 +1075,7 @@ linearize preds graph = do
, show $
indent 2 $
"the following left-over constraints are not defining constraints for a unique variable:"
/> vcat (map (pretty . snd) ps)
/> vsep (map (pretty . snd) ps)
]
go (n : ns) ps = do
let (nps, ops) = partition (isLastVariable n . fst) ps
Expand Down Expand Up @@ -4140,7 +4140,7 @@ instance Pretty (Name fn) where
pretty (Name v) = pretty v

prettyLinear :: [(Name fn, [Pred fn])] -> Doc ann
prettyLinear ln = vcat [pretty n <+> "<-" /> vcat (map pretty ps) | (Name n, ps) <- ln]
prettyLinear ln = vsep [pretty n <+> "<-" /> vsep (map pretty ps) | (Name n, ps) <- ln]

-- ======================================================================
-- Size and its 'generic' operations over Sized types.
Expand Down
2 changes: 1 addition & 1 deletion libs/constrained-generators/src/Constrained/Graph.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ instance Ord node => Monoid (Graph node) where
mempty = Graph mempty mempty

instance Pretty n => Pretty (Graph n) where
pretty gr = vcat [nest 2 $ pretty n <> " <- " <> pretty (Set.toList ns) | (n, ns) <- Map.toList (edges gr)]
pretty gr = vsep [nest 2 $ pretty n <> " <- " <> pretty (Set.toList ns) | (n, ns) <- Map.toList (edges gr)]

nodes :: Graph node -> Set node
nodes (Graph e _) = Map.keysSet e
Expand Down

0 comments on commit 17d8417

Please sign in to comment.