From 2d7f9e71101f58eb7125496411fe6f57e39eb3d1 Mon Sep 17 00:00:00 2001 From: Daniel Harvey Date: Thu, 30 Nov 2023 13:37:41 +0000 Subject: [PATCH 1/4] Try it in CI I guess --- .github/workflows/wasm-calc-haskell.yml | 2 +- cabal.project | 2 +- flake.nix | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/wasm-calc-haskell.yml b/.github/workflows/wasm-calc-haskell.yml index 3d78d990..0f38d688 100644 --- a/.github/workflows/wasm-calc-haskell.yml +++ b/.github/workflows/wasm-calc-haskell.yml @@ -35,7 +35,7 @@ jobs: - uses: haskell/actions/setup@v2 with: - ghc-version: '9.6.2' + ghc-version: '9.6.3' cabal-version: '3.10.1.0' - name: Build the universe diff --git a/cabal.project b/cabal.project index 36f125b9..423d3691 100644 --- a/cabal.project +++ b/cabal.project @@ -3,7 +3,7 @@ packages: wasm-calc2/wasm-calc2.cabal, wasm-calc3/wasm-calc3.cabal -with-compiler: ghc-9.6.2 +with-compiler: ghc-9.6.3 package diagnose flags: +megaparsec-compat diff --git a/flake.nix b/flake.nix index 1ad2e171..4f399d53 100644 --- a/flake.nix +++ b/flake.nix @@ -14,7 +14,7 @@ # current compiler version, ideally, we'll put everything here # eventually - compilerVersion = "ghc962"; + compilerVersion = "ghc963"; # fix things haskell = pkgs.haskell // { From 152ec96bcc1e8f5acb36f723a55cde2d89804245 Mon Sep 17 00:00:00 2001 From: Daniel Harvey Date: Thu, 30 Nov 2023 13:40:12 +0000 Subject: [PATCH 2/4] Bump flake --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index eb26ae06..608dd587 100644 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1695389639, - "narHash": "sha256-lUf18e/rCL/Ibf4UwDtNfgYcfHY1HZj4oSywLURbq1E=", + "lastModified": 1701351541, + "narHash": "sha256-XWwdlTkftY7SrY1HamkF2WAz3IGO2nEHEneYI/GPr4M=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e0c3bef334c012a62f67eefc58ffec92c3da9ae3", + "rev": "df20638983cdaa8963757ec17d92b97990b72625", "type": "github" }, "original": { From 8413c3ef4d614d5d9a3b9575b21a8f122608d05b Mon Sep 17 00:00:00 2001 From: Daniel Harvey Date: Thu, 30 Nov 2023 13:46:18 +0000 Subject: [PATCH 3/4] Fix nix --- cabal.project.freeze | 251 ------------------------------------------- flake.nix | 5 + 2 files changed, 5 insertions(+), 251 deletions(-) delete mode 100644 cabal.project.freeze diff --git a/cabal.project.freeze b/cabal.project.freeze deleted file mode 100644 index 2988a5f6..00000000 --- a/cabal.project.freeze +++ /dev/null @@ -1,251 +0,0 @@ -active-repositories: hackage.haskell.org:merge -constraints: any.Cabal ==3.10.1.0, - any.Cabal-syntax ==3.10.1.0, - any.Glob ==0.10.2, - any.HUnit ==1.6.2.0, - any.OneTuple ==0.4.1.1, - any.Only ==0.1, - any.QuickCheck ==2.14.3, - QuickCheck -old-random +templatehaskell, - any.StateVar ==1.2.2, - any.adjunctions ==4.4.2, - any.aeson ==2.1.2.1, - aeson -cffi +ordered-keymap, - any.aeson-pretty ==0.8.9, - aeson-pretty -lib-only, - any.alex ==3.2.7.4, - any.ansi-terminal ==1.0, - ansi-terminal -example, - any.ansi-terminal-types ==0.11.5, - any.array ==0.5.5.0, - any.assoc ==1.1, - assoc +tagged, - any.async ==2.2.4, - async -bench, - any.atomic-primops ==0.8.4, - atomic-primops -debug, - any.attoparsec ==0.14.4, - attoparsec -developer, - any.auto-update ==0.1.6, - any.base ==4.18.0.0, - any.base-compat ==0.13.0, - any.base-compat-batteries ==0.13.0, - any.base-orphans ==0.9.0, - any.basement ==0.0.16, - any.bifunctors ==5.6.1, - bifunctors +tagged, - any.binary ==0.8.9.1, - any.binary-orphans ==1.0.4.1, - any.bitvec ==1.1.4.0, - bitvec -libgmp, - any.bytestring ==0.11.4.0, - any.cabal-doctest ==1.0.9, - any.call-stack ==0.4.0, - any.case-insensitive ==1.2.1.0, - any.cassava ==0.5.3.0, - cassava -bytestring--lt-0_10_4, - any.cereal ==0.5.8.3, - cereal -bytestring-builder, - any.clock ==0.8.3, - clock -llvm, - any.cmdargs ==0.10.22, - cmdargs +quotation -testprog, - any.code-page ==0.2.1, - any.colour ==2.3.6, - any.comonad ==5.0.8, - comonad +containers +distributive +indexed-traversable, - any.conduit ==1.3.5, - any.conduit-extra ==1.3.6, - any.containers ==0.6.7, - any.contravariant ==1.5.5, - contravariant +semigroups +statevar +tagged, - any.cookie ==0.4.6, - any.criterion ==1.6.2.0, - criterion -embed-data-files -fast, - any.criterion-measurement ==0.2.1.0, - criterion-measurement -fast, - any.cryptonite ==0.30, - cryptonite -check_alignment +integer-gmp -old_toolchain_inliner +support_aesni +support_deepseq -support_pclmuldq +support_rdrand -support_sse +use_target_attributes, - any.data-default ==0.7.1.1, - any.data-default-class ==0.1.2.0, - any.data-default-instances-containers ==0.0.1, - any.data-default-instances-dlist ==0.0.1, - any.data-default-instances-old-locale ==0.0.1, - any.data-fix ==0.3.2, - any.data-sketches ==0.3.1.0, - any.data-sketches-core ==0.1.0.0, - any.deepseq ==1.4.8.1, - any.dense-linear-algebra ==0.1.0.0, - any.diagnose ==2.4.0, - diagnose -json +megaparsec-compat -parsec-compat, - any.digest ==0.0.1.7, - digest +pkg-config, - any.directory ==1.3.8.1, - any.distributive ==0.6.2.1, - distributive +semigroups +tagged, - any.dlist ==1.0, - dlist -werror, - any.easy-file ==0.2.5, - any.exceptions ==0.10.7, - any.fail ==4.9.0.0, - any.fast-logger ==3.2.1, - any.file-embed ==0.0.15.0, - any.filepath ==1.4.100.1, - any.free ==5.2, - any.generically ==0.1.1, - any.generics-sop ==0.5.1.3, - any.ghc-bignum ==1.3, - any.ghc-boot-th ==9.6.2, - any.ghc-prim ==0.10.0, - any.happy ==1.20.1.1, - any.hashable ==1.4.2.0, - hashable +integer-gmp -random-initial-seed, - any.haskeline ==0.8.2.1, - any.haskell-lexer ==1.1.1, - any.hsc2hs ==0.68.9, - hsc2hs -in-ghc-tree, - any.hspec ==2.11.1, - any.hspec-api ==2.11.1, - any.hspec-core ==2.11.1, - any.hspec-discover ==2.11.1, - any.hspec-expectations ==0.8.3, - any.http-media ==0.8.0.0, - any.ieee754 ==0.8.0, - any.indexed-profunctors ==0.1.1, - any.indexed-traversable ==0.1.2.1, - any.indexed-traversable-instances ==0.1.1.2, - any.insert-ordered-containers ==0.2.5.2, - any.integer-gmp ==1.1, - any.integer-logarithms ==1.0.3.1, - integer-logarithms -check-bounds +integer-gmp, - any.invariant ==0.6.1, - any.js-chart ==2.9.4.1, - any.kan-extensions ==5.2.5, - any.ki ==1.0.1.0, - any.lens ==5.2.2, - lens -benchmark-uniplate -dump-splices +inlining -j +test-hunit +test-properties +test-templates +trustworthy, - any.lifted-base ==0.2.3.12, - any.llvm-hs ==9.0.1, - llvm-hs -debug +shared-llvm, - any.logict ==0.8.1.0, - any.math-functions ==0.3.4.2, - math-functions +system-erf +system-expm1, - any.megaparsec ==9.4.1, - megaparsec -dev, - any.memory ==0.18.0, - memory +support_bytestring +support_deepseq, - any.microstache ==1.0.2.3, - any.monad-control ==1.0.3.1, - any.monad-logger ==0.3.40, - monad-logger +template_haskell, - any.monad-loops ==0.4.3, - monad-loops +base4, - any.mono-traversable ==1.0.15.3, - any.mtl ==2.3.1, - any.mwc-random ==0.15.0.2, - any.network ==3.1.4.0, - network -devel, - any.nonempty-containers ==0.3.4.4, - any.nonempty-vector ==0.2.2.0, - any.old-locale ==1.0.0.7, - any.old-time ==1.1.0.3, - any.openapi3 ==3.2.3, - any.optics-core ==0.4.1, - optics-core -explicit-generic-labels, - any.optics-extra ==0.4.2.1, - any.optics-th ==0.4.1, - any.optparse-applicative ==0.18.1.0, - optparse-applicative +process, - any.parallel ==3.2.2.0, - any.parsec ==3.1.16.1, - any.parser-combinators ==1.3.0, - parser-combinators -dev, - any.pretty ==1.1.3.6, - any.prettyprinter ==1.7.1, - prettyprinter -buildreadme +text, - any.prettyprinter-ansi-terminal ==1.1.3, - any.primitive ==0.8.0.0, - any.process ==1.6.17.0, - any.profunctors ==5.6.2, - any.prometheus-client ==1.1.0, - any.quickcheck-io ==0.2.0, - any.random ==1.2.1.1, - any.reflection ==2.1.7, - reflection -slow +template-haskell, - any.resourcet ==1.3.0, - any.rts ==1.0.2, - any.scientific ==0.3.7.0, - scientific -bytestring-builder -integer-simple, - any.semialign ==1.3, - semialign +semigroupoids, - any.semigroupoids ==6.0.0.1, - semigroupoids +comonad +containers +contravariant +distributive +tagged +unordered-containers, - any.semigroups ==0.20, - semigroups +binary +bytestring -bytestring-builder +containers +deepseq +hashable +tagged +template-haskell +text +transformers +unordered-containers, - any.smallcheck ==1.2.1.1, - any.sop-core ==0.5.0.2, - any.split ==0.2.3.5, - any.splitmix ==0.1.0.4, - splitmix -optimised-mixer, - any.statistics ==0.16.2.0, - any.stm ==2.5.1.0, - any.stm-chans ==3.0.0.9, - any.streaming-commons ==0.2.2.6, - streaming-commons -use-bytestring-builder, - any.strict ==0.5, - any.string-conversions ==0.4.0.1, - any.tagged ==0.8.7, - tagged +deepseq +transformers, - any.tasty ==1.4.3, - tasty +unix, - any.tasty-golden ==2.3.5, - tasty-golden -build-example, - any.tasty-hspec ==1.2.0.4, - any.tasty-hunit ==0.10.0.3, - any.tasty-quickcheck ==0.10.2, - any.tasty-smallcheck ==0.8.2, - any.template-haskell ==2.20.0.0, - any.temporary ==1.3, - any.terminfo ==0.4.1.6, - any.text ==2.0.2, - any.text-short ==0.1.5, - text-short -asserts, - any.tf-random ==0.5, - any.th-abstraction ==0.5.0.0, - any.these ==1.2, - any.time ==1.12.2, - any.time-compat ==1.9.6.1, - time-compat -old-locale, - any.transformers ==0.6.1.0, - any.transformers-base ==0.4.6, - transformers-base +orphaninstances, - any.transformers-compat ==0.7.2, - transformers-compat -five +five-three -four +generic-deriving +mtl -three -two, - any.typed-process ==0.2.11.0, - any.unix ==2.8.1.0, - any.unix-compat ==0.7, - unix-compat -old-time, - any.unix-time ==0.4.9, - any.unliftio-core ==0.2.1.0, - any.unordered-containers ==0.2.19.1, - unordered-containers -debug, - any.utf8-string ==1.0.2, - any.uuid-types ==1.0.5, - any.vector ==0.13.0.0, - vector +boundschecks -internalchecks -unsafechecks -wall, - any.vector-algorithms ==0.9.0.1, - vector-algorithms +bench +boundschecks -internalchecks -llvm +properties -unsafechecks, - any.vector-binary-instances ==0.2.5.2, - any.vector-stream ==0.1.0.0, - any.vector-th-unbox ==0.2.2, - any.void ==0.7.3, - void -safe, - any.wasm ==1.1.1, - any.wcwidth ==0.0.2, - wcwidth -cli +split-base, - any.witherable ==0.4.2, - any.zip-archive ==0.4.3, - zip-archive -executable, - any.zlib ==0.6.3.0, - zlib -bundled-c-zlib -non-blocking-ffi -pkg-config -index-state: hackage.haskell.org 2023-06-20T05:12:03Z diff --git a/flake.nix b/flake.nix index 4f399d53..857504d5 100644 --- a/flake.nix +++ b/flake.nix @@ -30,6 +30,11 @@ cabal-fmt = pkgs.haskell.lib.dontCheck (pkgs.haskell.lib.overrideCabal super.cabal-fmt (drv: { enableSeparateBinOutput = false; })); + # try and remove cycle + ormolu = pkgs.haskell.lib.dontCheck (pkgs.haskell.lib.overrideCabal super.ormolu (drv: { + enableSeparateBinOutput = false; + })); + }; }; From 04688045b90dd354ee0db775d0d280e737dd4bad Mon Sep 17 00:00:00 2001 From: Daniel Harvey Date: Thu, 30 Nov 2023 13:52:18 +0000 Subject: [PATCH 4/4] Fix --- cabal.project.freeze | 85 ++++++++++++++++++++++++++ wasm-calc/src/Calc/Repl.hs | 5 +- wasm-calc2/src/Calc/Repl.hs | 5 +- wasm-calc2/src/Calc/Typecheck/Error.hs | 2 +- wasm-calc3/src/Calc/Repl.hs | 5 +- wasm-calc3/src/Calc/Typecheck/Error.hs | 2 +- 6 files changed, 93 insertions(+), 11 deletions(-) create mode 100644 cabal.project.freeze diff --git a/cabal.project.freeze b/cabal.project.freeze new file mode 100644 index 00000000..0f417b18 --- /dev/null +++ b/cabal.project.freeze @@ -0,0 +1,85 @@ +active-repositories: hackage.haskell.org:merge +constraints: any.HUnit ==1.6.2.0, + any.QuickCheck ==2.14.3, + QuickCheck -old-random +templatehaskell, + any.alex ==3.2.7.4, + any.ansi-terminal ==1.0, + ansi-terminal -example, + any.ansi-terminal-types ==0.11.5, + any.array ==0.5.5.0, + any.base ==4.18.1.0, + any.binary ==0.8.9.1, + any.bytestring ==0.11.5.2, + any.call-stack ==0.4.0, + any.case-insensitive ==1.2.1.0, + any.cereal ==0.5.8.3, + cereal -bytestring-builder, + any.colour ==2.3.6, + any.containers ==0.6.7, + any.data-default ==0.7.1.1, + any.data-default-class ==0.1.2.0, + any.data-default-instances-containers ==0.0.1, + any.data-default-instances-dlist ==0.0.1, + any.data-default-instances-old-locale ==0.0.1, + any.deepseq ==1.4.8.1, + any.diagnose ==2.5.1, + diagnose -json +megaparsec-compat -parsec-compat, + any.directory ==1.3.8.1, + any.dlist ==1.0, + dlist -werror, + any.exceptions ==0.10.7, + any.file-embed ==0.0.15.0, + any.filepath ==1.4.100.4, + any.ghc-bignum ==1.3, + any.ghc-boot-th ==9.6.3, + any.ghc-prim ==0.10.0, + any.happy ==1.20.1.1, + any.hashable ==1.4.3.0, + hashable +integer-gmp -random-initial-seed, + any.haskeline ==0.8.2.1, + any.haskell-lexer ==1.1.1, + any.hspec ==2.11.7, + any.hspec-core ==2.11.7, + any.hspec-discover ==2.11.7, + any.hspec-expectations ==0.8.4, + any.ieee754 ==0.8.0, + any.integer-logarithms ==1.0.3.1, + integer-logarithms -check-bounds +integer-gmp, + any.megaparsec ==9.6.0, + megaparsec -dev, + any.mtl ==2.3.1, + any.old-locale ==1.0.0.7, + any.parser-combinators ==1.3.0, + parser-combinators -dev, + any.pretty ==1.1.3.6, + any.prettyprinter ==1.7.1, + prettyprinter -buildreadme +text, + any.prettyprinter-ansi-terminal ==1.1.3, + any.primitive ==0.9.0.0, + any.process ==1.6.17.0, + any.quickcheck-io ==0.2.0, + any.random ==1.2.1.1, + any.rts ==1.0.2, + any.scientific ==0.3.7.0, + scientific -bytestring-builder -integer-simple, + any.splitmix ==0.1.0.5, + splitmix -optimised-mixer, + any.stm ==2.5.1.0, + any.string-conversions ==0.4.0.1, + any.template-haskell ==2.20.0.0, + any.terminfo ==0.4.1.6, + any.text ==2.0.2, + any.tf-random ==0.5, + any.time ==1.12.2, + any.transformers ==0.6.1.0, + any.unix ==2.8.1.0, + any.unordered-containers ==0.2.19.1, + unordered-containers -debug, + any.utf8-string ==1.0.2, + any.vector ==0.13.1.0, + vector +boundschecks -internalchecks -unsafechecks -wall, + any.vector-stream ==0.1.0.0, + any.wasm ==1.1.1, + any.wcwidth ==0.0.2, + wcwidth -cli +split-base +index-state: hackage.haskell.org 2023-10-25T21:01:40Z diff --git a/wasm-calc/src/Calc/Repl.hs b/wasm-calc/src/Calc/Repl.hs index cd873fd4..46bd3ae8 100644 --- a/wasm-calc/src/Calc/Repl.hs +++ b/wasm-calc/src/Calc/Repl.hs @@ -46,9 +46,8 @@ repl = do Left bundle -> do Diag.printDiagnostic Diag.stderr - True - True - 4 + Diag.WithUnicode + (Diag.TabSize 4) Diag.defaultStyle (fromErrorBundle bundle input) loop diff --git a/wasm-calc2/src/Calc/Repl.hs b/wasm-calc2/src/Calc/Repl.hs index 6404e0a3..72b337a4 100644 --- a/wasm-calc2/src/Calc/Repl.hs +++ b/wasm-calc2/src/Calc/Repl.hs @@ -84,9 +84,8 @@ printDiagnostic :: (MonadIO m) => Diag.Diagnostic Text -> m () printDiagnostic = Diag.printDiagnostic Diag.stderr - True - True - 4 + Diag.WithUnicode + (Diag.TabSize 4) Diag.defaultStyle -- | turn Megaparsec error + input into a Diagnostic diff --git a/wasm-calc2/src/Calc/Typecheck/Error.hs b/wasm-calc2/src/Calc/Typecheck/Error.hs index 42c269b0..5f713303 100644 --- a/wasm-calc2/src/Calc/Typecheck/Error.hs +++ b/wasm-calc2/src/Calc/Typecheck/Error.hs @@ -44,7 +44,7 @@ typeErrorDiagnostic :: Diag.Diagnostic Text typeErrorDiagnostic input e = let filename = "" - diag = Diag.addFile Diag.def filename (T.unpack input) + diag = Diag.addFile mempty filename (T.unpack input) report = case e of (PredicateIsNotBoolean _ foundType) -> Diag.Err diff --git a/wasm-calc3/src/Calc/Repl.hs b/wasm-calc3/src/Calc/Repl.hs index 3301688f..ddf31bdc 100644 --- a/wasm-calc3/src/Calc/Repl.hs +++ b/wasm-calc3/src/Calc/Repl.hs @@ -77,9 +77,8 @@ printDiagnostic :: (MonadIO m) => Diag.Diagnostic Text -> m () printDiagnostic = Diag.printDiagnostic Diag.stderr - True - True - 4 + Diag.WithUnicode + (Diag.TabSize 4) Diag.defaultStyle -- | turn Megaparsec error + input into a Diagnostic diff --git a/wasm-calc3/src/Calc/Typecheck/Error.hs b/wasm-calc3/src/Calc/Typecheck/Error.hs index 55362c7a..334e104e 100644 --- a/wasm-calc3/src/Calc/Typecheck/Error.hs +++ b/wasm-calc3/src/Calc/Typecheck/Error.hs @@ -52,7 +52,7 @@ typeErrorDiagnostic :: Diag.Diagnostic Text typeErrorDiagnostic input e = let filename = "" - diag = Diag.addFile Diag.def filename (T.unpack input) + diag = Diag.addFile mempty filename (T.unpack input) report = case e of (NonFunctionTypeFound _ ty) -> Diag.Err