From 606419a2df051ed8c3639d600b49c685b374e9bf Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Wed, 27 Nov 2024 12:07:31 -0700 Subject: [PATCH] Some manual formatting, based on Ormolu changes --- .../Unison/Codebase/Editor/HandleInput/RuntimeUtils.hs | 9 ++++----- unison-cli/src/Unison/Codebase/Transcript/Runner.hs | 5 ++--- unison-core/src/Unison/ABT/Normalized.hs | 9 ++------- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/unison-cli/src/Unison/Codebase/Editor/HandleInput/RuntimeUtils.hs b/unison-cli/src/Unison/Codebase/Editor/HandleInput/RuntimeUtils.hs index 8b903dc65f..96f2b098fa 100644 --- a/unison-cli/src/Unison/Codebase/Editor/HandleInput/RuntimeUtils.hs +++ b/unison-cli/src/Unison/Codebase/Editor/HandleInput/RuntimeUtils.hs @@ -34,11 +34,10 @@ data EvalMode = Sandboxed | Permissive | Native selectRuntime :: EvalMode -> Cli (Runtime.Runtime Symbol) selectRuntime mode = - ask <&> \case - Cli.Env {runtime, sandboxedRuntime, nativeRuntime} - | Permissive <- mode -> runtime - | Sandboxed <- mode -> sandboxedRuntime - | Native <- mode -> nativeRuntime + ask <&> \Cli.Env {runtime, sandboxedRuntime, nativeRuntime} -> case mode of + Permissive -> runtime + Sandboxed -> sandboxedRuntime + Native -> nativeRuntime displayDecompileErrors :: [Runtime.Error] -> Cli () displayDecompileErrors errs = Cli.respond (PrintMessage msg) diff --git a/unison-cli/src/Unison/Codebase/Transcript/Runner.hs b/unison-cli/src/Unison/Codebase/Transcript/Runner.hs index caac754a3c..9c06e31da8 100644 --- a/unison-cli/src/Unison/Codebase/Transcript/Runner.hs +++ b/unison-cli/src/Unison/Codebase/Transcript/Runner.hs @@ -200,10 +200,9 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL outputUcmResult :: Pretty.Pretty Pretty.ColorText -> IO () outputUcmResult line = do hide <- hideOutput False - unless hide $ + unless hide . outputUcmLine . UcmOutputLine . Text.pack $ -- We shorten the terminal width, because "Transcript" manages a 2-space indent for output lines. - outputUcmLine . UcmOutputLine . Text.pack $ - Pretty.toPlain (terminalWidth - 2) line + Pretty.toPlain (terminalWidth - 2) line maybeDieWithMsg :: String -> IO () maybeDieWithMsg msg = do diff --git a/unison-core/src/Unison/ABT/Normalized.hs b/unison-core/src/Unison/ABT/Normalized.hs index 3281366f08..1fc0316048 100644 --- a/unison-core/src/Unison/ABT/Normalized.hs +++ b/unison-core/src/Unison/ABT/Normalized.hs @@ -208,10 +208,7 @@ transform phi (TTm body) = TTm . second (transform phi) $ phi body transform phi (TAbs u body) = TAbs u $ transform phi body visit :: - (Applicative g) => - (Bifoldable f) => - (Traversable (f v)) => - (Var v) => + (Applicative g, Bifoldable f, Traversable (f v), Var v) => (Term f v -> Maybe (g (Term f v))) -> Term f v -> g (Term f v) @@ -220,9 +217,7 @@ visit h t = flip fromMaybe (h t) $ case out t of Tm body -> TTm <$> traverse (visit h) body visitPure :: - (Bifoldable f) => - (Traversable (f v)) => - (Var v) => + (Bifoldable f, Traversable (f v), Var v) => (Term f v -> Maybe (Term f v)) -> Term f v -> Term f v