Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/trunk' into better-CLI-error-m…
Browse files Browse the repository at this point in the history
…essages
  • Loading branch information
sellout committed Jul 5, 2024
2 parents a7f1c24 + a74d4e8 commit 0e76597
Show file tree
Hide file tree
Showing 468 changed files with 5,543 additions and 5,478 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ At a high level, the CI process is:
Some version numbers that are used during CI:
- `ormolu_version: "0.5.0.1"`
- `racket_version: "8.7"`
- `jit_version: "@unison/internal/releases/0.0.17"`
- `jit_version: "@unison/internal/releases/0.0.18"`

Some cached directories:
- `ucm_local_bin` a temp path for caching a built `ucm`
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
env:
ormolu_version: 0.5.2.0
ucm_local_bin: ucm-local-bin
jit_version: "@unison/internal/releases/0.0.17"
jit_version: "@unison/internal/releases/0.0.18"
jit_src_scheme: unison-jit-src/scheme-libs/racket
jit_dist: unison-jit-dist
jit_generator_os: ubuntu-20.04
Expand Down
2 changes: 1 addition & 1 deletion codebase2/codebase-sqlite/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ dependencies:
- unison-codebase
- unison-codebase-sync
- unison-core
- unison-core1
- unison-core-orphans-sqlite
- unison-hash
- unison-hash-orphans-sqlite
Expand All @@ -39,7 +40,6 @@ dependencies:
- unison-util-base32hex
- unison-util-cache
- unison-util-file-embed
- unison-util-nametree
- unison-util-serialization
- unison-util-term
- unliftio
Expand Down
2 changes: 1 addition & 1 deletion codebase2/codebase-sqlite/unison-codebase-sqlite.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,14 @@ library
, unison-codebase-sync
, unison-core
, unison-core-orphans-sqlite
, unison-core1
, unison-hash
, unison-hash-orphans-sqlite
, unison-prelude
, unison-sqlite
, unison-util-base32hex
, unison-util-cache
, unison-util-file-embed
, unison-util-nametree
, unison-util-serialization
, unison-util-term
, unliftio
Expand Down
1 change: 0 additions & 1 deletion contrib/cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ packages:
lib/unison-util-relation
lib/unison-util-rope
lib/unison-util-file-embed
lib/unison-util-nametree

parser-typechecker
unison-core
Expand Down
12 changes: 5 additions & 7 deletions lib/unison-prelude/src/Unison/Debug.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ module Unison.Debug
)
where

import Control.Applicative (empty)
import Control.Monad (when)
import Data.Set (Set)
import Data.Set qualified as Set
import Data.Text qualified as Text
import Debug.Pretty.Simple (pTrace, pTraceM, pTraceShowId, pTraceShowM)
import Debug.Pretty.Simple (pTrace, pTraceM)
import System.IO.Unsafe (unsafePerformIO)
import Text.Pretty.Simple (pShow)
import Unison.Prelude
import UnliftIO.Environment (lookupEnv)

data DebugFlag
Expand Down Expand Up @@ -148,7 +147,7 @@ debugPatternCoverageConstraintSolver = PatternCoverageConstraintSolver `Set.memb
debug :: (Show a) => DebugFlag -> String -> a -> a
debug flag msg a =
if shouldDebug flag
then pTraceShowId (pTrace (msg <> ":\n") a)
then (pTrace (msg <> ":\n" <> into @String (pShow a)) a)
else a

-- | Use for selective debug logging in monadic contexts.
Expand All @@ -159,8 +158,7 @@ debug flag msg a =
debugM :: (Show a, Monad m) => DebugFlag -> String -> a -> m ()
debugM flag msg a =
whenDebug flag do
pTraceM (msg <> ":\n")
pTraceShowM a
traceM (msg <> ":\n" <> into @String (pShow a))

debugLog :: DebugFlag -> String -> a -> a
debugLog flag msg =
Expand Down
14 changes: 7 additions & 7 deletions lib/unison-pretty-printer/src/Unison/Util/Pretty.hs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ module Unison.Util.Pretty
lineSkip,
nonEmpty,
numbered,
numberedColumn2,
numberedColumn2ListFrom,
numberedColumn2Header,
numberedColumnNHeader,
numberedList,
Expand Down Expand Up @@ -544,12 +544,12 @@ numberedHeader num ps = column2 (fmap num (Nothing : fmap Just [1 ..]) `zip` toL
-- 1. one thing : this is a thing
-- 2. another thing : this is another thing
-- 3. and another : yet one more thing
numberedColumn2 ::
(Foldable f, LL.ListLike s Char, IsString s) =>
(Int -> Pretty s) ->
f (Pretty s, Pretty s) ->
Pretty s
numberedColumn2 num ps = numbered num (align $ toList ps)
numberedColumn2ListFrom ::
(Foldable f) =>
Int ->
f (Pretty ColorText, Pretty ColorText) ->
Pretty ColorText
numberedColumn2ListFrom num ps = numberedListFrom num (align $ toList ps)

numberedColumn2Header ::
(Foldable f, LL.ListLike s Char, IsString s) =>
Expand Down
56 changes: 0 additions & 56 deletions lib/unison-util-nametree/package.yaml

This file was deleted.

68 changes: 0 additions & 68 deletions lib/unison-util-nametree/unison-util-nametree.cabal

This file was deleted.

1 change: 0 additions & 1 deletion parser-typechecker/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ dependencies:
- unison-util-base32hex
- unison-util-bytes
- unison-util-cache
- unison-util-nametree
- unison-util-relation
- unison-util-rope
- unison-util-serialization
Expand Down
26 changes: 6 additions & 20 deletions parser-typechecker/src/Unison/Codebase/Path.hs
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,13 @@ module Unison.Codebase.Path
toList,
toName,
toName',
unsafeToName,
unsafeToName',
toText,
toText',
unsplit,
unsplit',
unsplitAbsolute,
unsplitHQ,
unsplitHQ',
nameFromHQSplit,
nameFromHQSplit',
nameFromSplit',
splitFromName,
splitFromName',
Expand Down Expand Up @@ -171,11 +169,11 @@ unsplitAbsolute :: (Absolute, NameSegment) -> Absolute
unsplitAbsolute =
coerce unsplit

unsplitHQ :: HQSplit -> HQ'.HashQualified Path
unsplitHQ (p, a) = fmap (snoc p) a
nameFromHQSplit :: HQSplit -> HQ'.HashQualified Name
nameFromHQSplit = nameFromHQSplit' . first (RelativePath' . Relative)

unsplitHQ' :: HQSplit' -> HQ'.HashQualified Path'
unsplitHQ' (p, a) = fmap (snoc' p) a
nameFromHQSplit' :: HQSplit' -> HQ'.HashQualified Name
nameFromHQSplit' (p, a) = fmap (nameFromSplit' . (p,)) a

type Split = (Path, NameSegment)

Expand Down Expand Up @@ -316,9 +314,6 @@ cons = Lens.cons
snoc :: Path -> NameSegment -> Path
snoc = Lens.snoc

snoc' :: Path' -> NameSegment -> Path'
snoc' = Lens.snoc

unsnoc :: Path -> Maybe (Path, NameSegment)
unsnoc = Lens.unsnoc

Expand All @@ -344,15 +339,6 @@ fromName' n
where
path = fromName n

unsafeToName :: Path -> Name
unsafeToName =
fromMaybe (error "empty path") . toName

-- | Convert a Path' to a Name
unsafeToName' :: Path' -> Name
unsafeToName' =
fromMaybe (error "empty path") . toName'

toName :: Path -> Maybe Name
toName = \case
Path Seq.Empty -> Nothing
Expand Down
4 changes: 1 addition & 3 deletions parser-typechecker/unison-parser-typechecker.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 1.12

-- This file has been generated from package.yaml by hpack version 0.35.2.
-- This file has been generated from package.yaml by hpack version 0.36.0.
--
-- see: https://github.com/sol/hpack

Expand Down Expand Up @@ -330,7 +330,6 @@ library
, unison-util-base32hex
, unison-util-bytes
, unison-util-cache
, unison-util-nametree
, unison-util-relation
, unison-util-rope
, unison-util-serialization
Expand Down Expand Up @@ -532,7 +531,6 @@ test-suite parser-typechecker-tests
, unison-util-base32hex
, unison-util-bytes
, unison-util-cache
, unison-util-nametree
, unison-util-relation
, unison-util-rope
, unison-util-serialization
Expand Down
Loading

0 comments on commit 0e76597

Please sign in to comment.