From 25e9bc6efe8bba503b431dce4d54f5c8a406c986 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Akg=C3=BCn?= Date: Sat, 20 Apr 2024 23:25:14 +0100 Subject: [PATCH] lint --- src/Conjure/Process/Streamlining.hs | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/Conjure/Process/Streamlining.hs b/src/Conjure/Process/Streamlining.hs index e95ac44de..4f1264f68 100644 --- a/src/Conjure/Process/Streamlining.hs +++ b/src/Conjure/Process/Streamlining.hs @@ -35,10 +35,10 @@ streamliningToStdout model = do streamliners <- streamlining model liftIO $ print $ prettyList prBraces "," - [ (showStr $ show i) <> ":" <+> prBraces (vcat + [ showStr (show i) <> ":" <+> prBraces (vcat [ showStr "onVariable" <> ":" <+> showStr (show (pretty nm)) <> "," - , showStr "groups" <> ":" <+> prettyList prBrackets "," (map showStr groups) <> "," - , showStr "constraint" <> ":" <+> (showStr $ map whitespace $ show $ pretty cons) + , showStr "groups" <> ":" <+> prettyList prBrackets "," (map showStr (nub groups)) <> "," + , showStr "constraint" <> ":" <+> showStr (map whitespace $ show $ pretty cons) ]) | (i, (nm, (cons, groups))) <- zip allNats streamliners ] @@ -53,16 +53,15 @@ streamlining :: (?typeCheckerMode :: TypeCheckerMode) => Model -> m [(Name, Streamliner)] streamlining model = do - concatForM (mStatements model) $ \ statement -> - case statement of - Declaration (FindOrGiven Find nm domain) -> do - let ref = Reference nm (Just (DeclNoRepr Find nm domain NoRegion)) - streamliners <- streamlinersForSingleVariable ref - -- traceM $ show $ vcat [ "Streamliners for --" <+> pretty statement - -- , vcat [ nest 4 (vcat (pretty x : map pretty gs)) | (x,gs) <- streamliners ] - -- ] - return [ (nm, s) | s <- streamliners ] - _ -> noStreamliner + concatForM (mStatements model) $ \case + Declaration (FindOrGiven Find nm domain) -> do + let ref = Reference nm (Just (DeclNoRepr Find nm domain NoRegion)) + streamliners <- streamlinersForSingleVariable ref + -- traceM $ show $ vcat [ "Streamliners for --" <+> pretty statement + -- , vcat [ nest 4 (vcat (pretty x : map pretty gs)) | (x,gs) <- streamliners ] + -- ] + return [ (nm, s) | s <- streamliners ] + _ -> noStreamliner type StreamlinerGroup = String