Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/trunk' into transcript-edit
Browse files Browse the repository at this point in the history
  • Loading branch information
sellout committed Nov 26, 2024
2 parents b7edcd6 + 612756d commit 7e26050
Show file tree
Hide file tree
Showing 58 changed files with 4,090 additions and 2,981 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bundle-ucm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
tries=5
for (( i = 0; i < $tries; i++ )); do
stack build :unison \
--flag unison-parser-typechecker:optimized \
--ghc-options='-O2' \
--local-bin-path ucm-bin \
--copy-bins \
&& break;
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ dist-newstyle
*.hie
*.prof
*.prof.html
*.hp
*.ps
/.direnv/
/.envrc

Expand Down
2 changes: 1 addition & 1 deletion lib/unison-hash/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: unison-hash
github: unisonweb/unison
copyright: Copyright (C) 2013-2021 Unison Computing, PBC and contributors

ghc-options: -Wall -O0 -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures
ghc-options: -Wall -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures

dependencies:
- base
Expand Down
4 changes: 2 additions & 2 deletions lib/unison-hash/unison-hash.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.36.0.
-- This file has been generated from package.yaml by hpack version 0.37.0.
--
-- see: https://github.com/sol/hpack

Expand Down Expand Up @@ -49,7 +49,7 @@ library
TypeApplications
TypeFamilies
ViewPatterns
ghc-options: -Wall -O0 -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures
ghc-options: -Wall -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures
build-depends:
base
, bytestring
Expand Down
2 changes: 1 addition & 1 deletion lib/unison-hashing/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: unison-hashing
github: unisonweb/unison
copyright: Copyright (C) 2013-2021 Unison Computing, PBC and contributors

ghc-options: -Wall -O0 -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures
ghc-options: -Wall -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures

dependencies:
- base
Expand Down
4 changes: 2 additions & 2 deletions lib/unison-hashing/unison-hashing.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.37.0.
--
-- see: https://github.com/sol/hpack

Expand Down Expand Up @@ -48,7 +48,7 @@ library
TypeApplications
TypeFamilies
ViewPatterns
ghc-options: -Wall -O0 -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures
ghc-options: -Wall -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures
build-depends:
base
, unison-hash
Expand Down
8 changes: 8 additions & 0 deletions lib/unison-prelude/src/Unison/Debug.hs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ data DebugFlag
| -- | Useful for adding temporary debugging statements during development.
-- Remove uses of Debug.Temp before merging to keep things clean for the next person :)
Temp
| -- | Debugging the interpreter
Interpreter
| -- | Shows Annotations when printing terms
Annotations
| -- | Debug endpoints of the local UI (or Share) server
Expand Down Expand Up @@ -65,6 +67,7 @@ debugFlags = case (unsafePerformIO (lookupEnv "UNISON_DEBUG")) of
"LSP" -> pure LSP
"TIMING" -> pure Timing
"TEMP" -> pure Temp
"INTERPRETER" -> pure Interpreter
"ANNOTATIONS" -> pure Annotations
"SERVER" -> pure Server
"PATTERN_COVERAGE" -> pure PatternCoverage
Expand Down Expand Up @@ -114,6 +117,10 @@ debugTemp :: Bool
debugTemp = Temp `Set.member` debugFlags
{-# NOINLINE debugTemp #-}

debugInterpreter :: Bool
debugInterpreter = Interpreter `Set.member` debugFlags
{-# NOINLINE debugInterpreter #-}

debugAnnotations :: Bool
debugAnnotations = Annotations `Set.member` debugFlags
{-# NOINLINE debugAnnotations #-}
Expand Down Expand Up @@ -187,6 +194,7 @@ shouldDebug = \case
LSP -> debugLSP
Timing -> debugTiming
Temp -> debugTemp
Interpreter -> debugInterpreter
Annotations -> debugAnnotations
Server -> debugServer
PatternCoverage -> debugPatternCoverage
Expand Down
11 changes: 1 addition & 10 deletions lib/unison-pretty-printer/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,7 @@ default-extensions:
- TypeApplications
- ViewPatterns

ghc-options: -Wall -O0 -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures

flags:
optimized:
manual: true
default: true

when:
- condition: flag(optimized)
ghc-options: -funbox-strict-fields -O2
ghc-options: -Wall -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures

library:
when:
Expand Down
18 changes: 4 additions & 14 deletions lib/unison-pretty-printer/unison-pretty-printer.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.36.0.
-- This file has been generated from package.yaml by hpack version 0.37.0.
--
-- see: https://github.com/sol/hpack

Expand All @@ -17,10 +17,6 @@ source-repository head
type: git
location: https://github.com/unisonweb/unison

flag optimized
manual: True
default: True

library
exposed-modules:
Unison.PrettyTerminal
Expand Down Expand Up @@ -54,7 +50,7 @@ library
TupleSections
TypeApplications
ViewPatterns
ghc-options: -Wall -O0 -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures
ghc-options: -Wall -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures
build-depends:
ListLike
, ansi-terminal
Expand All @@ -70,8 +66,6 @@ library
, unison-syntax
, unliftio
default-language: Haskell2010
if flag(optimized)
ghc-options: -funbox-strict-fields -O2

executable prettyprintdemo
main-is: Main.hs
Expand Down Expand Up @@ -99,14 +93,12 @@ executable prettyprintdemo
TupleSections
TypeApplications
ViewPatterns
ghc-options: -Wall -O0 -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures
ghc-options: -Wall -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures
build-depends:
base
, text
, unison-pretty-printer
default-language: Haskell2010
if flag(optimized)
ghc-options: -funbox-strict-fields -O2

test-suite pretty-printer-tests
type: exitcode-stdio-1.0
Expand Down Expand Up @@ -139,7 +131,7 @@ test-suite pretty-printer-tests
TupleSections
TypeApplications
ViewPatterns
ghc-options: -Wall -O0 -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures -W -threaded -rtsopts "-with-rtsopts=-N -T" -v0
ghc-options: -Wall -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures -W -threaded -rtsopts "-with-rtsopts=-N -T" -v0
build-depends:
base
, code-page
Expand All @@ -149,5 +141,3 @@ test-suite pretty-printer-tests
, unison-pretty-printer
, unison-syntax
default-language: Haskell2010
if flag(optimized)
ghc-options: -funbox-strict-fields -O2
11 changes: 1 addition & 10 deletions parser-typechecker/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,7 @@ name: unison-parser-typechecker
github: unisonweb/unison
copyright: Copyright (C) 2013-2021 Unison Computing, PBC and contributors

ghc-options: -Wall -O0 -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures

flags:
optimized:
manual: true
default: true

when:
- condition: flag(optimized)
ghc-options: -funbox-strict-fields -O2
ghc-options: -Wall -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures

library:
source-dirs: src
Expand Down
2 changes: 1 addition & 1 deletion parser-typechecker/src/Unison/Codebase/Runtime.hs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ data CompileOpts = COpts
}

defaultCompileOpts :: CompileOpts
defaultCompileOpts = COpts { profile = False }
defaultCompileOpts = COpts {profile = False}

data Runtime v = Runtime
{ terminate :: IO (),
Expand Down
1 change: 0 additions & 1 deletion parser-typechecker/src/Unison/Syntax/TermPrinter.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1285,7 +1285,6 @@ instance Monoid PrintAnnotation where

suffixCounterTerm :: (Var v) => PrettyPrintEnv -> Set Name -> Set Name -> Term2 v at ap v a -> PrintAnnotation
suffixCounterTerm n usedTm usedTy = \case
Var' v -> countHQ mempty $ HQ.unsafeFromVar v
Ref' r -> countHQ usedTm $ PrettyPrintEnv.termName n (Referent.Ref r)
Constructor' r | noImportRefs (r ^. ConstructorReference.reference_) -> mempty
Constructor' r -> countHQ usedTm $ PrettyPrintEnv.termName n (Referent.Con r CT.Data)
Expand Down
5 changes: 4 additions & 1 deletion parser-typechecker/src/Unison/Util/EnumContainers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ module Unison.Util.EnumContainers
where

import Data.Bifunctor
import Data.Functor.Classes (Eq1, Ord1)
import Data.IntMap.Strict qualified as IM
import Data.IntSet qualified as IS
import Data.Word (Word16, Word64)
Expand Down Expand Up @@ -60,7 +61,9 @@ newtype EnumMap k a = EM (IM.IntMap a)
)
deriving newtype
( Monoid,
Semigroup
Semigroup,
Eq1,
Ord1
)

newtype EnumSet k = ES IS.IntSet
Expand Down
14 changes: 3 additions & 11 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.36.0.
-- This file has been generated from package.yaml by hpack version 0.37.0.
--
-- see: https://github.com/sol/hpack

Expand All @@ -17,10 +17,6 @@ source-repository head
type: git
location: https://github.com/unisonweb/unison

flag optimized
manual: True
default: True

library
exposed-modules:
U.Codebase.Branch.Diff
Expand Down Expand Up @@ -195,7 +191,7 @@ library
TypeApplications
TypeFamilies
ViewPatterns
ghc-options: -Wall -O0 -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures
ghc-options: -Wall -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures
build-depends:
ListLike
, aeson
Expand Down Expand Up @@ -256,8 +252,6 @@ library
, vector
, witherable
default-language: Haskell2010
if flag(optimized)
ghc-options: -funbox-strict-fields -O2

test-suite parser-typechecker-tests
type: exitcode-stdio-1.0
Expand Down Expand Up @@ -317,7 +311,7 @@ test-suite parser-typechecker-tests
TypeApplications
TypeFamilies
ViewPatterns
ghc-options: -Wall -O0 -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures -W -threaded -rtsopts "-with-rtsopts=-N -T" -v0
ghc-options: -Wall -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures -W -threaded -rtsopts "-with-rtsopts=-N -T" -v0
build-depends:
base
, code-page
Expand All @@ -339,5 +333,3 @@ test-suite parser-typechecker-tests
, unison-util-relation
, unison-util-rope
default-language: Haskell2010
if flag(optimized)
ghc-options: -funbox-strict-fields -O2
2 changes: 1 addition & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ allow-newer-deps:

ghc-options:
# All packages
"$locals": -Wall -Werror -Wno-name-shadowing -Wno-missing-pattern-synonym-signatures -fprint-expanded-synonyms -fwrite-ide-info -Wunused-packages #-freverse-errors
"$locals": -Wall -Werror -Wno-name-shadowing -Wno-missing-pattern-synonym-signatures -fprint-expanded-synonyms -fwrite-ide-info -Wunused-packages -funbox-strict-fields #-freverse-errors

# See https://github.com/haskell/haskell-language-server/issues/208
"$everything": -haddock
Expand Down
9 changes: 0 additions & 9 deletions unison-cli-integration/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ name: unison-cli-integration
github: unisonweb/unison
copyright: Copyright (C) 2013-2018 Unison Computing, PBC and contributors

flags:
optimized:
manual: true
default: false

ghc-options: -Wall

executables:
Expand All @@ -28,10 +23,6 @@ executables:
build-tools:
- unison-cli-main:unison

when:
- condition: flag(optimized)
ghc-options: -O2 -funbox-strict-fields

default-extensions:
- ApplicativeDo
- BangPatterns
Expand Down
8 changes: 1 addition & 7 deletions unison-cli-integration/unison-cli-integration.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.36.0.
-- This file has been generated from package.yaml by hpack version 0.37.0.
--
-- see: https://github.com/sol/hpack

Expand All @@ -15,10 +15,6 @@ source-repository head
type: git
location: https://github.com/unisonweb/unison

flag optimized
manual: True
default: False

executable cli-integration-tests
main-is: Suite.hs
other-modules:
Expand Down Expand Up @@ -70,5 +66,3 @@ executable cli-integration-tests
, process
, time
default-language: Haskell2010
if flag(optimized)
ghc-options: -O2 -funbox-strict-fields
9 changes: 0 additions & 9 deletions unison-cli-main/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ name: unison-cli-main
github: unisonweb/unison
copyright: Copyright (C) 2013-2018 Unison Computing, PBC and contributors

flags:
optimized:
manual: true
default: false

ghc-options: -Wall

executables:
Expand All @@ -24,10 +19,6 @@ executables:
- text
- unison-cli

when:
- condition: flag(optimized)
ghc-options: -O2 -funbox-strict-fields

default-extensions:
- ApplicativeDo
- BangPatterns
Expand Down
Loading

0 comments on commit 7e26050

Please sign in to comment.