diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..6cfedcb0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,38 @@ +name: concat +on: + push: + branches: + - master + pull_request: + types: + - opened + - synchronize +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + ghc: + # - "8.0.2" # We've (temporarily?) lost support for these, but still + # - "8.2.2" # have conditional compilation for them. We should either + # - "8.4.1" # fix (some) of them or remove the CPP. + - "8.6.1" + - "8.8.1" + - "8.10.1" + steps: + - uses: actions/checkout@v2 + - uses: haskell/actions/setup@v1 + id: setup-haskell-cabal + with: + ghc-version: ${{ matrix.ghc }} + cabal-version: "3.6.0.0" + - run: cabal v2-update + - run: cabal v2-freeze $CONFIG + - uses: actions/cache@v2 + with: + path: | + ${{ steps.setup-haskell-cabal.outputs.cabal-store }} + dist-newstyle + key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }} + - run: cabal new-build all + - run: cabal new-test gold-tests diff --git a/cabal.project b/cabal.project index 9115b3df..b98dc105 100644 --- a/cabal.project +++ b/cabal.project @@ -16,11 +16,6 @@ source-repository-package tag: master subdir: verilog -source-repository-package - type: git - location: https://github.com/expipiplus1/vector-sized.git - tag: master - packages: ./inline/concat-inline.cabal ./plugin/concat-plugin.cabal diff --git a/examples/concat-examples.cabal b/examples/concat-examples.cabal index 60f6147b..a063bc13 100644 --- a/examples/concat-examples.cabal +++ b/examples/concat-examples.cabal @@ -61,7 +61,6 @@ library , concat-inline , concat-known , concat-classes - , concat-plugin if flag(smt) build-depends: z3 cpp-options: -DCONCAT_SMT @@ -114,70 +113,6 @@ library ghc-options: -O2 cpp-options: -DVectorSized --- Stack apparently only allows per-package flags, not per-component, so the --- whole library gets recompiled. For now, duplicate the test-suite. See --- - -Test-Suite misc-examples - type: exitcode-stdio-1.0 - default-language: Haskell98 - hs-Source-Dirs: test - main-is: Examples.hs - other-modules: Miscellany - Build-Depends: base<5 - , Cabal >= 1.24.0.0 - , ghc-prim - , constraints >= 0.8 - , newtype-generics >= 0.5.3 - , pointed, keys - , distributive, adjunctions - , concat-inline - , concat-classes - , concat-plugin - , concat-examples - , ghc-prim - , integer-gmp - , distributive, adjunctions - , constraints >= 0.8 - -- Array/vector experiments - , finite-typelits, vector-sized >= 1.0.0.0 - ghc-options: -O2 - -fplugin=ConCat.Plugin - if flag(smt) - cpp-options: -DCONCAT_SMT - cpp-options: -DVectorSized - -Test-Suite misc-trace - type: exitcode-stdio-1.0 - default-language: Haskell98 - hs-Source-Dirs: test - main-is: Examples.hs - other-modules: Miscellany - Build-Depends: base<5 - , Cabal >= 1.24.0.0 - , ghc-prim - , constraints >= 0.8 - , newtype-generics >= 0.5.3 - , pointed, keys - , distributive, adjunctions - , concat-inline - , concat-classes - , concat-plugin - , concat-examples - , ghc-prim - , integer-gmp - , keys - , distributive, adjunctions - , constraints >= 0.8 - -- Array/vector experiments - , finite-typelits, vector-sized - ghc-options: -O2 - -fplugin=ConCat.Plugin - -fplugin-opt=ConCat.Plugin:trace - if flag(smt) - cpp-options: -DCONCAT_SMT - cpp-options: -DVectorSized - -- Test-Suite testHasFins -- type: exitcode-stdio-1.0 -- default-language: Haskell98 @@ -189,58 +124,3 @@ Test-Suite misc-trace -- , concat-examples -- , concat-classes -- , ghc-typelits-knownnat - -Test-Suite gold-tests - type: exitcode-stdio-1.0 - default-language: Haskell98 - hs-Source-Dirs: test - main-is: GoldTests.hs - other-modules: BasicTests, Miscellany, Utils - Build-Depends: base<5 - , Cabal >= 1.24.0.0 - , ghc-prim - , constraints >= 0.8 - , newtype-generics >= 0.5.3 - , pointed, keys - , distributive, adjunctions - , vector - , concat-inline - , concat-classes - , concat-plugin - , concat-examples - , ghc-prim - , integer-gmp - , distributive, adjunctions - , constraints >= 0.8 - , bytestring - , tasty - , tasty-golden - -- Array/vector experiments - , finite-typelits, vector-sized >= 1.0.0.0 - ghc-options: -O2 - -fplugin=ConCat.Plugin --- -fplugin-opt=ConCat.Plugin:showCcc --- -dppr-debug -dverbose-core2core -dinline-check satisfy -ddump-inlinings - if flag(smt) - cpp-options: -DCONCAT_SMT - cpp-options: -DVectorSized - --- executable ad_rev --- hs-source-dirs: app --- main-is: ad_rev.lhs --- build-depends: base >= 4.7 && < 5 --- , optparse-generic --- , concat-classes --- , concat-examples --- , concat-plugin --- default-language: Haskell2010 --- ghc-options: -O2 --- -funbox-strict-fields --- -threaded --- -optc-ffast-math --- -optc-O3 --- -- -fplugin=ConCat.Plugin --- -- -fplugin-opt=ConCat.Plugin:trace --- -- -fplugin-opt=ConCat.Plugin:maxSteps=200 --- -- -fforce-recomp - diff --git a/plugin/concat-plugin.cabal b/plugin/concat-plugin.cabal index baffe004..3665a57a 100644 --- a/plugin/concat-plugin.cabal +++ b/plugin/concat-plugin.cabal @@ -18,6 +18,10 @@ source-repository head type: git location: git://github.com/conal/concat +Flag smt + Description: Enable SMT + Default: False + library default-language: Haskell2010 hs-source-dirs: src @@ -42,3 +46,121 @@ library -- Do I want to depend on integer-gmp? Maybe conditionally depend on integer-gmp -- or integer-simple. + +-- Stack apparently only allows per-package flags, not per-component, so the +-- whole library gets recompiled. For now, duplicate the test-suite. See +-- + +Test-Suite misc-examples + type: exitcode-stdio-1.0 + default-language: Haskell98 + hs-Source-Dirs: test + main-is: Examples.hs + other-modules: Miscellany + Build-Depends: base<5 + , Cabal >= 1.24.0.0 + , ghc-prim + , constraints >= 0.8 + , newtype-generics >= 0.5.3 + , pointed, keys + , distributive, adjunctions + , concat-inline + , concat-classes + , concat-plugin + , concat-examples + , ghc-prim + , integer-gmp + , distributive, adjunctions + , constraints >= 0.8 + -- Array/vector experiments + , finite-typelits, vector-sized >= 1.0.0.0 + ghc-options: -O2 + -fplugin=ConCat.Plugin + if flag(smt) + cpp-options: -DCONCAT_SMT + cpp-options: -DVectorSized + +Test-Suite misc-trace + type: exitcode-stdio-1.0 + default-language: Haskell98 + hs-Source-Dirs: test + main-is: Examples.hs + other-modules: Miscellany + Build-Depends: base<5 + , Cabal >= 1.24.0.0 + , ghc-prim + , constraints >= 0.8 + , newtype-generics >= 0.5.3 + , pointed, keys + , distributive, adjunctions + , concat-inline + , concat-classes + , concat-plugin + , concat-examples + , ghc-prim + , integer-gmp + , keys + , distributive, adjunctions + , constraints >= 0.8 + -- Array/vector experiments + , finite-typelits, vector-sized + ghc-options: -O2 + -fplugin=ConCat.Plugin + -fplugin-opt=ConCat.Plugin:trace + if flag(smt) + cpp-options: -DCONCAT_SMT + cpp-options: -DVectorSized + +Test-Suite gold-tests + type: exitcode-stdio-1.0 + default-language: Haskell98 + hs-Source-Dirs: test + main-is: GoldTests.hs + other-modules: BasicTests, Miscellany, Utils + Build-Depends: base<5 + , Cabal >= 1.24.0.0 + , ghc-prim + , constraints >= 0.8 + , newtype-generics >= 0.5.3 + , pointed, keys + , distributive, adjunctions + , vector + , concat-inline + , concat-classes + , concat-plugin + , concat-examples + , ghc-prim + , integer-gmp + , distributive, adjunctions + , constraints >= 0.8 + , bytestring + , tasty + , tasty-golden + -- Array/vector experiments + , finite-typelits, vector-sized >= 1.0.0.0 + ghc-options: -O2 + -fplugin=ConCat.Plugin +-- -fplugin-opt=ConCat.Plugin:showCcc +-- -dppr-debug -dverbose-core2core -dinline-check satisfy -ddump-inlinings + if flag(smt) + cpp-options: -DCONCAT_SMT + cpp-options: -DVectorSized + +-- executable ad_rev +-- hs-source-dirs: app +-- main-is: ad_rev.lhs +-- build-depends: base >= 4.7 && < 5 +-- , optparse-generic +-- , concat-classes +-- , concat-examples +-- , concat-plugin +-- default-language: Haskell2010 +-- ghc-options: -O2 +-- -funbox-strict-fields +-- -threaded +-- -optc-ffast-math +-- -optc-O3 +-- -- -fplugin=ConCat.Plugin +-- -- -fplugin-opt=ConCat.Plugin:trace +-- -- -fplugin-opt=ConCat.Plugin:maxSteps=200 +-- -- -fforce-recomp diff --git a/examples/test/BasicTests.hs b/plugin/test/BasicTests.hs similarity index 100% rename from examples/test/BasicTests.hs rename to plugin/test/BasicTests.hs diff --git a/examples/test/Examples.hs b/plugin/test/Examples.hs similarity index 100% rename from examples/test/Examples.hs rename to plugin/test/Examples.hs diff --git a/examples/test/GoldTests.hs b/plugin/test/GoldTests.hs similarity index 100% rename from examples/test/GoldTests.hs rename to plugin/test/GoldTests.hs diff --git a/examples/test/Miscellany.hs b/plugin/test/Miscellany.hs similarity index 100% rename from examples/test/Miscellany.hs rename to plugin/test/Miscellany.hs diff --git a/examples/test/Utils.hs b/plugin/test/Utils.hs similarity index 100% rename from examples/test/Utils.hs rename to plugin/test/Utils.hs diff --git a/examples/test/gold/Makefile b/plugin/test/gold/Makefile similarity index 100% rename from examples/test/gold/Makefile rename to plugin/test/gold/Makefile diff --git a/examples/test/gold/add-adf-dot.golden b/plugin/test/gold/add-adf-dot.golden similarity index 100% rename from examples/test/gold/add-adf-dot.golden rename to plugin/test/gold/add-adf-dot.golden diff --git a/examples/test/gold/add-adf-syn.golden b/plugin/test/gold/add-adf-syn.golden similarity index 100% rename from examples/test/gold/add-adf-syn.golden rename to plugin/test/gold/add-adf-syn.golden diff --git a/examples/test/gold/add-adr-dot.golden b/plugin/test/gold/add-adr-dot.golden similarity index 100% rename from examples/test/gold/add-adr-dot.golden rename to plugin/test/gold/add-adr-dot.golden diff --git a/examples/test/gold/add-adr-syn.golden b/plugin/test/gold/add-adr-syn.golden similarity index 100% rename from examples/test/gold/add-adr-syn.golden rename to plugin/test/gold/add-adr-syn.golden diff --git a/examples/test/gold/add-dot.golden b/plugin/test/gold/add-dot.golden similarity index 100% rename from examples/test/gold/add-dot.golden rename to plugin/test/gold/add-dot.golden diff --git a/examples/test/gold/add-gradr-dot.golden b/plugin/test/gold/add-gradr-dot.golden similarity index 100% rename from examples/test/gold/add-gradr-dot.golden rename to plugin/test/gold/add-gradr-dot.golden diff --git a/examples/test/gold/add-gradr-syn.golden b/plugin/test/gold/add-gradr-syn.golden similarity index 100% rename from examples/test/gold/add-gradr-syn.golden rename to plugin/test/gold/add-gradr-syn.golden diff --git a/examples/test/gold/add-syn.golden b/plugin/test/gold/add-syn.golden similarity index 100% rename from examples/test/gold/add-syn.golden rename to plugin/test/gold/add-syn.golden diff --git a/examples/test/gold/add-uncurry-dot.golden b/plugin/test/gold/add-uncurry-dot.golden similarity index 100% rename from examples/test/gold/add-uncurry-dot.golden rename to plugin/test/gold/add-uncurry-dot.golden diff --git a/examples/test/gold/add-uncurry-syn.golden b/plugin/test/gold/add-uncurry-syn.golden similarity index 100% rename from examples/test/gold/add-uncurry-syn.golden rename to plugin/test/gold/add-uncurry-syn.golden diff --git a/examples/test/gold/complex-mul-a-dot.golden b/plugin/test/gold/complex-mul-a-dot.golden similarity index 100% rename from examples/test/gold/complex-mul-a-dot.golden rename to plugin/test/gold/complex-mul-a-dot.golden diff --git a/examples/test/gold/complex-mul-a-syn.golden b/plugin/test/gold/complex-mul-a-syn.golden similarity index 100% rename from examples/test/gold/complex-mul-a-syn.golden rename to plugin/test/gold/complex-mul-a-syn.golden diff --git a/examples/test/gold/complex-mul-dot.golden b/plugin/test/gold/complex-mul-dot.golden similarity index 100% rename from examples/test/gold/complex-mul-dot.golden rename to plugin/test/gold/complex-mul-dot.golden diff --git a/examples/test/gold/complex-mul-syn.golden b/plugin/test/gold/complex-mul-syn.golden similarity index 100% rename from examples/test/gold/complex-mul-syn.golden rename to plugin/test/gold/complex-mul-syn.golden diff --git a/examples/test/gold/cos-2x-adf-dot.golden b/plugin/test/gold/cos-2x-adf-dot.golden similarity index 100% rename from examples/test/gold/cos-2x-adf-dot.golden rename to plugin/test/gold/cos-2x-adf-dot.golden diff --git a/examples/test/gold/cos-2x-adf-syn.golden b/plugin/test/gold/cos-2x-adf-syn.golden similarity index 100% rename from examples/test/gold/cos-2x-adf-syn.golden rename to plugin/test/gold/cos-2x-adf-syn.golden diff --git a/examples/test/gold/cos-2x-adr-dot.golden b/plugin/test/gold/cos-2x-adr-dot.golden similarity index 100% rename from examples/test/gold/cos-2x-adr-dot.golden rename to plugin/test/gold/cos-2x-adr-dot.golden diff --git a/examples/test/gold/cos-2x-adr-syn.golden b/plugin/test/gold/cos-2x-adr-syn.golden similarity index 100% rename from examples/test/gold/cos-2x-adr-syn.golden rename to plugin/test/gold/cos-2x-adr-syn.golden diff --git a/examples/test/gold/cos-2x-gradr-dot.golden b/plugin/test/gold/cos-2x-gradr-dot.golden similarity index 100% rename from examples/test/gold/cos-2x-gradr-dot.golden rename to plugin/test/gold/cos-2x-gradr-dot.golden diff --git a/examples/test/gold/cos-2x-gradr-syn.golden b/plugin/test/gold/cos-2x-gradr-syn.golden similarity index 100% rename from examples/test/gold/cos-2x-gradr-syn.golden rename to plugin/test/gold/cos-2x-gradr-syn.golden diff --git a/examples/test/gold/cos-2xx-adf-dot.golden b/plugin/test/gold/cos-2xx-adf-dot.golden similarity index 100% rename from examples/test/gold/cos-2xx-adf-dot.golden rename to plugin/test/gold/cos-2xx-adf-dot.golden diff --git a/examples/test/gold/cos-2xx-adf-syn.golden b/plugin/test/gold/cos-2xx-adf-syn.golden similarity index 100% rename from examples/test/gold/cos-2xx-adf-syn.golden rename to plugin/test/gold/cos-2xx-adf-syn.golden diff --git a/examples/test/gold/cos-2xx-adr-dot.golden b/plugin/test/gold/cos-2xx-adr-dot.golden similarity index 100% rename from examples/test/gold/cos-2xx-adr-dot.golden rename to plugin/test/gold/cos-2xx-adr-dot.golden diff --git a/examples/test/gold/cos-2xx-adr-syn.golden b/plugin/test/gold/cos-2xx-adr-syn.golden similarity index 100% rename from examples/test/gold/cos-2xx-adr-syn.golden rename to plugin/test/gold/cos-2xx-adr-syn.golden diff --git a/examples/test/gold/cos-2xx-dot.golden b/plugin/test/gold/cos-2xx-dot.golden similarity index 100% rename from examples/test/gold/cos-2xx-dot.golden rename to plugin/test/gold/cos-2xx-dot.golden diff --git a/examples/test/gold/cos-2xx-gradr-dot.golden b/plugin/test/gold/cos-2xx-gradr-dot.golden similarity index 100% rename from examples/test/gold/cos-2xx-gradr-dot.golden rename to plugin/test/gold/cos-2xx-gradr-dot.golden diff --git a/examples/test/gold/cos-2xx-gradr-syn.golden b/plugin/test/gold/cos-2xx-gradr-syn.golden similarity index 100% rename from examples/test/gold/cos-2xx-gradr-syn.golden rename to plugin/test/gold/cos-2xx-gradr-syn.golden diff --git a/examples/test/gold/cos-2xx-syn.golden b/plugin/test/gold/cos-2xx-syn.golden similarity index 100% rename from examples/test/gold/cos-2xx-syn.golden rename to plugin/test/gold/cos-2xx-syn.golden diff --git a/examples/test/gold/cos-adf-dot.golden b/plugin/test/gold/cos-adf-dot.golden similarity index 100% rename from examples/test/gold/cos-adf-dot.golden rename to plugin/test/gold/cos-adf-dot.golden diff --git a/examples/test/gold/cos-adf-syn.golden b/plugin/test/gold/cos-adf-syn.golden similarity index 100% rename from examples/test/gold/cos-adf-syn.golden rename to plugin/test/gold/cos-adf-syn.golden diff --git a/examples/test/gold/cos-adr-dot.golden b/plugin/test/gold/cos-adr-dot.golden similarity index 100% rename from examples/test/gold/cos-adr-dot.golden rename to plugin/test/gold/cos-adr-dot.golden diff --git a/examples/test/gold/cos-adr-syn.golden b/plugin/test/gold/cos-adr-syn.golden similarity index 100% rename from examples/test/gold/cos-adr-syn.golden rename to plugin/test/gold/cos-adr-syn.golden diff --git a/examples/test/gold/cos-gradr-dot.golden b/plugin/test/gold/cos-gradr-dot.golden similarity index 100% rename from examples/test/gold/cos-gradr-dot.golden rename to plugin/test/gold/cos-gradr-dot.golden diff --git a/examples/test/gold/cos-gradr-syn.golden b/plugin/test/gold/cos-gradr-syn.golden similarity index 100% rename from examples/test/gold/cos-gradr-syn.golden rename to plugin/test/gold/cos-gradr-syn.golden diff --git a/examples/test/gold/cos-xpy-adf-dot.golden b/plugin/test/gold/cos-xpy-adf-dot.golden similarity index 100% rename from examples/test/gold/cos-xpy-adf-dot.golden rename to plugin/test/gold/cos-xpy-adf-dot.golden diff --git a/examples/test/gold/cos-xpy-adf-syn.golden b/plugin/test/gold/cos-xpy-adf-syn.golden similarity index 100% rename from examples/test/gold/cos-xpy-adf-syn.golden rename to plugin/test/gold/cos-xpy-adf-syn.golden diff --git a/examples/test/gold/cos-xpy-adr-dot.golden b/plugin/test/gold/cos-xpy-adr-dot.golden similarity index 100% rename from examples/test/gold/cos-xpy-adr-dot.golden rename to plugin/test/gold/cos-xpy-adr-dot.golden diff --git a/examples/test/gold/cos-xpy-adr-syn.golden b/plugin/test/gold/cos-xpy-adr-syn.golden similarity index 100% rename from examples/test/gold/cos-xpy-adr-syn.golden rename to plugin/test/gold/cos-xpy-adr-syn.golden diff --git a/examples/test/gold/cos-xpy-gradr-dot.golden b/plugin/test/gold/cos-xpy-gradr-dot.golden similarity index 100% rename from examples/test/gold/cos-xpy-gradr-dot.golden rename to plugin/test/gold/cos-xpy-gradr-dot.golden diff --git a/examples/test/gold/cos-xpy-gradr-syn.golden b/plugin/test/gold/cos-xpy-gradr-syn.golden similarity index 100% rename from examples/test/gold/cos-xpy-gradr-syn.golden rename to plugin/test/gold/cos-xpy-gradr-syn.golden diff --git a/examples/test/gold/cosSinProd-adr-dot.golden b/plugin/test/gold/cosSinProd-adr-dot.golden similarity index 100% rename from examples/test/gold/cosSinProd-adr-dot.golden rename to plugin/test/gold/cosSinProd-adr-dot.golden diff --git a/examples/test/gold/cosSinProd-adr-syn.golden b/plugin/test/gold/cosSinProd-adr-syn.golden similarity index 100% rename from examples/test/gold/cosSinProd-adr-syn.golden rename to plugin/test/gold/cosSinProd-adr-syn.golden diff --git a/examples/test/gold/cosSinProd-dot.golden b/plugin/test/gold/cosSinProd-dot.golden similarity index 100% rename from examples/test/gold/cosSinProd-dot.golden rename to plugin/test/gold/cosSinProd-dot.golden diff --git a/examples/test/gold/cosSinProd-syn.golden b/plugin/test/gold/cosSinProd-syn.golden similarity index 100% rename from examples/test/gold/cosSinProd-syn.golden rename to plugin/test/gold/cosSinProd-syn.golden diff --git a/examples/test/gold/dup-dot.golden b/plugin/test/gold/dup-dot.golden similarity index 100% rename from examples/test/gold/dup-dot.golden rename to plugin/test/gold/dup-dot.golden diff --git a/examples/test/gold/dup-syn.golden b/plugin/test/gold/dup-syn.golden similarity index 100% rename from examples/test/gold/dup-syn.golden rename to plugin/test/gold/dup-syn.golden diff --git a/examples/test/gold/fst-dot.golden b/plugin/test/gold/fst-dot.golden similarity index 100% rename from examples/test/gold/fst-dot.golden rename to plugin/test/gold/fst-dot.golden diff --git a/examples/test/gold/fst-syn.golden b/plugin/test/gold/fst-syn.golden similarity index 100% rename from examples/test/gold/fst-syn.golden rename to plugin/test/gold/fst-syn.golden diff --git a/examples/test/gold/horner-dot.golden b/plugin/test/gold/horner-dot.golden similarity index 100% rename from examples/test/gold/horner-dot.golden rename to plugin/test/gold/horner-dot.golden diff --git a/examples/test/gold/horner-syn.golden b/plugin/test/gold/horner-syn.golden similarity index 100% rename from examples/test/gold/horner-syn.golden rename to plugin/test/gold/horner-syn.golden diff --git a/examples/test/gold/log-2xx-dot.golden b/plugin/test/gold/log-2xx-dot.golden similarity index 100% rename from examples/test/gold/log-2xx-dot.golden rename to plugin/test/gold/log-2xx-dot.golden diff --git a/examples/test/gold/log-2xx-syn.golden b/plugin/test/gold/log-2xx-syn.golden similarity index 100% rename from examples/test/gold/log-2xx-syn.golden rename to plugin/test/gold/log-2xx-syn.golden diff --git a/examples/test/gold/magSqr-adf-dot.golden b/plugin/test/gold/magSqr-adf-dot.golden similarity index 100% rename from examples/test/gold/magSqr-adf-dot.golden rename to plugin/test/gold/magSqr-adf-dot.golden diff --git a/examples/test/gold/magSqr-adf-syn.golden b/plugin/test/gold/magSqr-adf-syn.golden similarity index 100% rename from examples/test/gold/magSqr-adf-syn.golden rename to plugin/test/gold/magSqr-adf-syn.golden diff --git a/examples/test/gold/magSqr-adr-dot.golden b/plugin/test/gold/magSqr-adr-dot.golden similarity index 100% rename from examples/test/gold/magSqr-adr-dot.golden rename to plugin/test/gold/magSqr-adr-dot.golden diff --git a/examples/test/gold/magSqr-adr-syn.golden b/plugin/test/gold/magSqr-adr-syn.golden similarity index 100% rename from examples/test/gold/magSqr-adr-syn.golden rename to plugin/test/gold/magSqr-adr-syn.golden diff --git a/examples/test/gold/magSqr-dot.golden b/plugin/test/gold/magSqr-dot.golden similarity index 100% rename from examples/test/gold/magSqr-dot.golden rename to plugin/test/gold/magSqr-dot.golden diff --git a/examples/test/gold/magSqr-gradr-dot.golden b/plugin/test/gold/magSqr-gradr-dot.golden similarity index 100% rename from examples/test/gold/magSqr-gradr-dot.golden rename to plugin/test/gold/magSqr-gradr-dot.golden diff --git a/examples/test/gold/magSqr-gradr-syn.golden b/plugin/test/gold/magSqr-gradr-syn.golden similarity index 100% rename from examples/test/gold/magSqr-gradr-syn.golden rename to plugin/test/gold/magSqr-gradr-syn.golden diff --git a/examples/test/gold/magSqr-syn.golden b/plugin/test/gold/magSqr-syn.golden similarity index 100% rename from examples/test/gold/magSqr-syn.golden rename to plugin/test/gold/magSqr-syn.golden diff --git a/examples/test/gold/sin-adf-dot.golden b/plugin/test/gold/sin-adf-dot.golden similarity index 100% rename from examples/test/gold/sin-adf-dot.golden rename to plugin/test/gold/sin-adf-dot.golden diff --git a/examples/test/gold/sin-adf-syn.golden b/plugin/test/gold/sin-adf-syn.golden similarity index 100% rename from examples/test/gold/sin-adf-syn.golden rename to plugin/test/gold/sin-adf-syn.golden diff --git a/examples/test/gold/sin-adr-dot.golden b/plugin/test/gold/sin-adr-dot.golden similarity index 100% rename from examples/test/gold/sin-adr-dot.golden rename to plugin/test/gold/sin-adr-dot.golden diff --git a/examples/test/gold/sin-adr-syn.golden b/plugin/test/gold/sin-adr-syn.golden similarity index 100% rename from examples/test/gold/sin-adr-syn.golden rename to plugin/test/gold/sin-adr-syn.golden diff --git a/examples/test/gold/sin-gradr-dot.golden b/plugin/test/gold/sin-gradr-dot.golden similarity index 100% rename from examples/test/gold/sin-gradr-dot.golden rename to plugin/test/gold/sin-gradr-dot.golden diff --git a/examples/test/gold/sin-gradr-syn.golden b/plugin/test/gold/sin-gradr-syn.golden similarity index 100% rename from examples/test/gold/sin-gradr-syn.golden rename to plugin/test/gold/sin-gradr-syn.golden diff --git a/examples/test/gold/sqr-adf-dot.golden b/plugin/test/gold/sqr-adf-dot.golden similarity index 100% rename from examples/test/gold/sqr-adf-dot.golden rename to plugin/test/gold/sqr-adf-dot.golden diff --git a/examples/test/gold/sqr-adf-syn.golden b/plugin/test/gold/sqr-adf-syn.golden similarity index 100% rename from examples/test/gold/sqr-adf-syn.golden rename to plugin/test/gold/sqr-adf-syn.golden diff --git a/examples/test/gold/sqr-adr-dot.golden b/plugin/test/gold/sqr-adr-dot.golden similarity index 100% rename from examples/test/gold/sqr-adr-dot.golden rename to plugin/test/gold/sqr-adr-dot.golden diff --git a/examples/test/gold/sqr-adr-syn.golden b/plugin/test/gold/sqr-adr-syn.golden similarity index 100% rename from examples/test/gold/sqr-adr-syn.golden rename to plugin/test/gold/sqr-adr-syn.golden diff --git a/examples/test/gold/sqr-dot.golden b/plugin/test/gold/sqr-dot.golden similarity index 100% rename from examples/test/gold/sqr-dot.golden rename to plugin/test/gold/sqr-dot.golden diff --git a/examples/test/gold/sqr-gradr-dot.golden b/plugin/test/gold/sqr-gradr-dot.golden similarity index 100% rename from examples/test/gold/sqr-gradr-dot.golden rename to plugin/test/gold/sqr-gradr-dot.golden diff --git a/examples/test/gold/sqr-gradr-syn.golden b/plugin/test/gold/sqr-gradr-syn.golden similarity index 100% rename from examples/test/gold/sqr-gradr-syn.golden rename to plugin/test/gold/sqr-gradr-syn.golden diff --git a/examples/test/gold/sqr-syn.golden b/plugin/test/gold/sqr-syn.golden similarity index 100% rename from examples/test/gold/sqr-syn.golden rename to plugin/test/gold/sqr-syn.golden diff --git a/examples/test/gold/twice-adf-dot.golden b/plugin/test/gold/twice-adf-dot.golden similarity index 100% rename from examples/test/gold/twice-adf-dot.golden rename to plugin/test/gold/twice-adf-dot.golden diff --git a/examples/test/gold/twice-adf-syn.golden b/plugin/test/gold/twice-adf-syn.golden similarity index 100% rename from examples/test/gold/twice-adf-syn.golden rename to plugin/test/gold/twice-adf-syn.golden diff --git a/examples/test/gold/twice-adr-dot.golden b/plugin/test/gold/twice-adr-dot.golden similarity index 100% rename from examples/test/gold/twice-adr-dot.golden rename to plugin/test/gold/twice-adr-dot.golden diff --git a/examples/test/gold/twice-adr-syn.golden b/plugin/test/gold/twice-adr-syn.golden similarity index 100% rename from examples/test/gold/twice-adr-syn.golden rename to plugin/test/gold/twice-adr-syn.golden diff --git a/examples/test/gold/twice-dot.golden b/plugin/test/gold/twice-dot.golden similarity index 100% rename from examples/test/gold/twice-dot.golden rename to plugin/test/gold/twice-dot.golden diff --git a/examples/test/gold/twice-gradr-dot.golden b/plugin/test/gold/twice-gradr-dot.golden similarity index 100% rename from examples/test/gold/twice-gradr-dot.golden rename to plugin/test/gold/twice-gradr-dot.golden diff --git a/examples/test/gold/twice-gradr-syn.golden b/plugin/test/gold/twice-gradr-syn.golden similarity index 100% rename from examples/test/gold/twice-gradr-syn.golden rename to plugin/test/gold/twice-gradr-syn.golden diff --git a/examples/test/gold/twice-syn.golden b/plugin/test/gold/twice-syn.golden similarity index 100% rename from examples/test/gold/twice-syn.golden rename to plugin/test/gold/twice-syn.golden diff --git a/examples/test/gold/xp3y-dot.golden b/plugin/test/gold/xp3y-dot.golden similarity index 100% rename from examples/test/gold/xp3y-dot.golden rename to plugin/test/gold/xp3y-dot.golden diff --git a/examples/test/gold/xp3y-syn.golden b/plugin/test/gold/xp3y-syn.golden similarity index 100% rename from examples/test/gold/xp3y-syn.golden rename to plugin/test/gold/xp3y-syn.golden diff --git a/satisfy/src/ConCat/BuildDictionary.hs b/satisfy/src/ConCat/BuildDictionary.hs index c35579b1..17c9e75e 100644 --- a/satisfy/src/ConCat/BuildDictionary.hs +++ b/satisfy/src/ConCat/BuildDictionary.hs @@ -73,6 +73,13 @@ import qualified UniqSet as NonDetSet import ConCat.Simplify +isEvVarType' :: Type -> Bool +#if MIN_VERSION_GLASGOW_HASKELL(8, 8, 0, 0) +isEvVarType' = isEvVarType +#else +isEvVarType' = isPredTy +#endif + isFound :: FindResult -> Bool isFound (Found _ _) = True isFound _ = False @@ -184,7 +191,7 @@ buildDictionary :: HscEnv -> DynFlags -> ModGuts -> UniqSupply -> InScopeEnv -> buildDictionary env dflags guts uniqSupply inScope evType@(TyConApp tyCon evTypes) ev goalTy | isTupleTyCon tyCon = reallyBuildDictionary env dflags guts uniqSupply inScope evType evTypes ev goalTy -- only 1-tuples in Haskell -buildDictionary env dflags guts uniqSupply inScope evType ev goalTy | isEvVarType evType = +buildDictionary env dflags guts uniqSupply inScope evType ev goalTy | isEvVarType' evType = reallyBuildDictionary env dflags guts uniqSupply inScope evType [evType] ev goalTy buildDictionary _env _dflags _guts _uniqSupply _inScope evT _ev _goalTy = pprPanic "evidence type mismatch" (ppr evT)