Skip to content

Commit

Permalink
Some manual formatting, based on Ormolu changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sellout committed Nov 27, 2024
1 parent 6d14ff1 commit 606419a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 2 additions & 3 deletions unison-cli/src/Unison/Codebase/Transcript/Runner.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 2 additions & 7 deletions unison-core/src/Unison/ABT/Normalized.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 606419a

Please sign in to comment.