Skip to content

Add support for GHC 8.6. #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 0 additions & 5 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
120 changes: 0 additions & 120 deletions examples/concat-examples.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ library
, concat-inline
, concat-known
, concat-classes
, concat-plugin
if flag(smt)
build-depends: z3
cpp-options: -DCONCAT_SMT
Expand Down Expand Up @@ -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
-- <https://stackoverflow.com/questions/45015821/setting-component-specific-cabal-flag-from-stack-build>

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
Expand All @@ -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

122 changes: 122 additions & 0 deletions plugin/concat-plugin.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
-- <https://stackoverflow.com/questions/45015821/setting-component-specific-cabal-flag-from-stack-build>

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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 8 additions & 1 deletion satisfy/src/ConCat/BuildDictionary.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down