Skip to content
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

Support only GHC 9.0 #357

Merged
merged 74 commits into from
Nov 28, 2021
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
ee5be07
Set up development container
tfausak Oct 30, 2021
9940aa4
Get a working build plan
tfausak Oct 30, 2021
abba866
Sort dependencies
tfausak Oct 30, 2021
7bd98ff
Upgrade dependencies and tighten bounds
tfausak Oct 30, 2021
116930a
Get everything building with (only) GHC 9.0
tfausak Oct 30, 2021
515595b
Append final newline
tfausak Oct 30, 2021
0f035fa
Fix matching of `LastStmt`
tfausak Nov 2, 2021
22361c4
Fix getting binders from `HsForAllTy`
tfausak Nov 2, 2021
bd860f9
Fix type variable name
tfausak Nov 2, 2021
bfdb280
Restore custom `Show` instance for `PPTextWrapper`
tfausak Nov 4, 2021
42cf56b
Switch to Purple Yolk
tfausak Nov 4, 2021
1ad34ae
Remove unused HLS
tfausak Nov 6, 2021
8290109
Fix handling of EOF
tfausak Nov 6, 2021
8535916
Add back EOF handling
tfausak Nov 6, 2021
b517eef
Fix handling of type families
tfausak Nov 6, 2021
eccd2de
Replace `Option` with `Maybe`
tfausak Nov 6, 2021
acdc30c
Comment out unused definitions
tfausak Nov 6, 2021
c361ba5
Avoid relying on `StarIsType`
tfausak Nov 6, 2021
0c33d9a
Remove redundant pattern matches
tfausak Nov 6, 2021
d89cf0a
Remove CPP
tfausak Nov 6, 2021
56ccbc9
Add `Paths_brittany` as an automatically generated module
tfausak Nov 6, 2021
19a092b
Remove CPP instances
tfausak Nov 6, 2021
1e7a94e
Inline `prelude.inc`
tfausak Nov 6, 2021
32da5de
Remove unused imports
tfausak Nov 6, 2021
e3deff4
Switch from `-Wall` to `-Weverything`
tfausak Nov 6, 2021
325798a
Remove unused dependencies
tfausak Nov 6, 2021
bb3a7d0
Remove unnecessary `Typeable` instances
tfausak Nov 6, 2021
7ce8738
Use canonical `Monad` instance
tfausak Nov 6, 2021
ce0aa4f
Use canonical `Monoid` instances
tfausak Nov 6, 2021
c02edec
Remove redundant constraints
tfausak Nov 6, 2021
2dced78
Make sure record updates are complete
tfausak Nov 6, 2021
72fd695
Don't enable any language extensions by default
tfausak Nov 6, 2021
09fabe8
Compress executable artifacts
tfausak Nov 6, 2021
09f7e17
Configure HLint
tfausak Nov 6, 2021
d1968b5
Remove redundant language extensions
tfausak Nov 6, 2021
8a4bfe0
Use layout for package description
tfausak Nov 6, 2021
33d2aa8
Use common stanzas in package description
tfausak Nov 6, 2021
69e0f9f
Expose all modules
tfausak Nov 6, 2021
d03decc
Remove unnecessary export lists
tfausak Nov 6, 2021
75cf5b8
Remove unused tests
tfausak Nov 6, 2021
392e5b7
Fix many HLint warnings
tfausak Nov 6, 2021
9501764
Move executable
tfausak Nov 6, 2021
2ab4064
Move library
tfausak Nov 6, 2021
75aed1c
Remove unnecessary GHC version parsing
tfausak Nov 6, 2021
0c720ee
Remove unnecessary flags
tfausak Nov 6, 2021
c2248cb
Ignore missed specializations
tfausak Nov 6, 2021
d879125
Combine unit test modules
tfausak Nov 6, 2021
9a9b67d
Merge unit tests into literate tests
tfausak Nov 6, 2021
5631e25
Merge interface tests into literate tests
tfausak Nov 6, 2021
93ba90e
Rename test suite
tfausak Nov 6, 2021
79be0ed
Move test suite
tfausak Nov 6, 2021
e22a647
Move literate test files
tfausak Nov 6, 2021
93172bf
Add flag for turning warnings into errors
tfausak Nov 6, 2021
694ce97
Remove Travis CI config
tfausak Nov 6, 2021
51ca8fd
Remove Nix configuration
tfausak Nov 6, 2021
a1cd4c5
Remove Make configuration
tfausak Nov 6, 2021
4ee386a
Remove unnecessary setup script
tfausak Nov 6, 2021
fdbbe98
Try to spend less time compressing binaries
tfausak Nov 6, 2021
208240b
Remvoe old Stack configs
tfausak Nov 6, 2021
ac81c5c
Update Stack config
tfausak Nov 6, 2021
4398b58
Format Brittany with Brittany
tfausak Nov 6, 2021
4079981
Revert "Format Brittany with Brittany"
tfausak Nov 7, 2021
8d7b46b
Fix handling of comments
tfausak Nov 7, 2021
ccd09ba
Remove obsolete Stack configuration
tfausak Nov 21, 2021
8fadac8
Format imports
tfausak Nov 21, 2021
fa8365a
Set up release job
tfausak Nov 21, 2021
cdc8405
Remove mentions of GHC 8.x
tfausak Nov 21, 2021
b8532ca
Fix release job dependency
tfausak Nov 21, 2021
ab59e9a
Parse modules "purely", without ghc-paths
tfausak Nov 21, 2021
89a9f47
Ignore warnings when parsing modules
tfausak Nov 21, 2021
21e86ad
Split tests into individual files
tfausak Nov 23, 2021
cddb98b
Run tests in serial
tfausak Nov 25, 2021
8f2625d
Simplify test suite
tfausak Nov 28, 2021
339d2eb
Version 0.14.0.0
tfausak Nov 28, 2021
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
30 changes: 30 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
ARG UBUNTU_TAG=20.04
FROM ubuntu:"$UBUNTU_TAG"

ENV LANG=C.UTF-8
RUN \
apt-get update && \
apt-get install --assume-yes curl gcc git libgmp-dev libtinfo-dev make sudo

ARG GHCUP_VERSION=0.1.17.3
RUN \
curl --output /usr/local/bin/ghcup "https://downloads.haskell.org/~ghcup/$GHCUP_VERSION/x86_64-linux-ghcup-$GHCUP_VERSION" && \
chmod +x /usr/local/bin/ghcup && \
ghcup --version

ARG USER_NAME=haskell
RUN \
useradd --create-home --shell "$( which bash )" "$USER_NAME" && \
echo "$USER_NAME ALL=(ALL) NOPASSWD: ALL" | tee "/etc/sudoers.d/$USER_NAME"
USER "$USER_NAME"
ENV PATH="/home/$USER_NAME/.cabal/bin:/home/$USER_NAME/.ghcup/bin:$PATH"

ARG GHC_VERSION=9.0.1
RUN \
ghcup install ghc "$GHC_VERSION" --set && \
ghc --version

ARG CABAL_VERSION=3.6.2.0
RUN \
ghcup install cabal "$CABAL_VERSION" --set && \
cabal --version
6 changes: 6 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"build": {
"dockerfile": "Dockerfile"
},
"postCreateCommand": "cabal update"
}
48 changes: 16 additions & 32 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,34 @@ name: CI
on:
pull_request:
branches:
- master
- main
push:
branches:
- master
- main
jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- macos-10.15
- ubuntu-18.04
- macos-11
- ubuntu-20.04
- windows-2019
ghc:
- 8.10.2
- 9.0.1
cabal:
- 3.2.0.0
include:
- os: ubuntu-18.04
ghc: 8.8.4
cabal: 3.2.0.0
- os: ubuntu-18.04
ghc: 8.6.5
cabal: 3.2.0.0
- 3.6.2.0
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- run: mkdir artifact
- run: mkdir artifact/${{ matrix.os }}
- id: setup-haskell
uses: actions/setup-haskell@v1
uses: haskell/actions/setup@v1
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- run: cabal configure --enable-tests
- run: cabal freeze
- run: cat cabal.project.freeze
- uses: actions/cache@v2
Expand All @@ -43,24 +39,12 @@ jobs:
restore-keys: |
${{ matrix.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-
${{ matrix.os }}-${{ matrix.ghc }}-
- run: cabal build
- run: cabal install --installdir artifact/${{ matrix.os }} --install-method copy
- run: cabal test --test-show-details direct
- run: cabal install --installdir output --install-method copy
- run: strip output/brittany*
- run: cabal check
- run: cabal sdist --output-dir artifact/${{ matrix.os }}
- uses: actions/upload-artifact@v2
with:
path: output/brittany*
name: brittany-${{ matrix.os }}-ghc-${{ matrix.ghc }}-${{ github.sha }}
- if: matrix.os == 'ubuntu-18.04' && matrix.ghc == '8.10.2'
uses: actions/upload-artifact@v2
with:
path: dist-newstyle/sdist/brittany-*.tar.gz
name: brittany-${{ github.sha }}.tar.gz
- run: cabal check


nix:
runs-on: ubuntu-latest
steps:
- uses: cachix/install-nix-action@v12
- uses: actions/checkout@v2
- run: nix-build
path: artifact
name: brittany-${{ github.sha }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ local/
.cabal-sandbox/
.stack-work/
cabal.sandbox.config
cabal.project.local
cabal.project.local*
cabal.project.freeze
.ghc.environment.*
result
.stack-work*
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"taylorfausak.purple-yolk"
]
}
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"purple-yolk.brittany.command": "false",
"purple-yolk.ghci.command": "cabal repl --repl-options -ddump-json",
"purple-yolk.hlint.command": "false",
"purple-yolk.hlint.onSave": false
}
62 changes: 31 additions & 31 deletions brittany.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ copyright: Copyright (C) 2016-2019 Lennart Spitzner
Copyright (C) 2019 PRODA LTD
category: Language
build-type: Simple
cabal-version: 1.18
cabal-version: 2.0
homepage: https://github.com/lspitzner/brittany/
bug-reports: https://github.com/lspitzner/brittany/issues
extra-doc-files: {
Expand Down Expand Up @@ -91,36 +91,36 @@ library {
-fno-warn-redundant-constraints
}
build-depends:
{ base >=4.12 && <4.15
, ghc >=8.6.1 && <8.11
, ghc-paths >=0.1.0.9 && <0.2
, ghc-exactprint >=0.5.8 && <0.6.5
, transformers >=0.5.2.0 && <0.6
, containers >=0.5.7.1 && <0.7
, mtl >=2.2.1 && <2.3
, text >=1.2 && <1.3
, multistate >=0.7.1.1 && <0.9
, syb >=0.6 && <0.8
, data-tree-print
, pretty >=1.1.3.3 && <1.2
, bytestring >=0.10.8.1 && <0.11
, directory >=1.2.6.2 && <1.4
, butcher >=1.3.1 && <1.4
, yaml >=0.8.18 && <0.12
, aeson >=1.0.1.0 && <1.6
, extra >=1.4.10 && <1.8
, uniplate >=1.6.12 && <1.7
, strict >=0.3.2 && <0.5
, monad-memo >=0.4.1 && <0.6
, unsafe >=0.0 && <0.1
, safe >=0.3.9 && <0.4
, deepseq >=1.4.2.0 && <1.5
, semigroups >=0.18.2 && <0.20
, cmdargs >=0.10.14 && <0.11
, czipwith >=1.0.1.0 && <1.1
, ghc-boot-th >=8.6.1 && <8.11
, filepath >=1.4.1.0 && <1.5
, random >= 1.1 && <1.3
{ base ^>= 4.15.0
, aeson ^>= 2.0.1
, butcher ^>= 1.3.3
, bytestring ^>= 0.10.12
, cmdargs ^>= 0.10.21
, containers ^>= 0.6.4
, czipwith ^>= 1.0.1
, data-tree-print ^>= 0.1.0
, deepseq ^>= 1.4.5
, directory ^>= 1.3.6
, extra ^>= 1.7.10
, filepath ^>= 1.4.2
, ghc ^>= 9.0.1
, ghc-boot-th ^>= 9.0.1
, ghc-exactprint ^>= 0.6.4
, ghc-paths ^>= 0.1.0
, monad-memo ^>= 0.5.3
, mtl ^>= 2.2.2
, multistate ^>= 0.8.0
, pretty ^>= 1.1.3
, random ^>= 1.2.1
, safe ^>= 0.3.19
, semigroups ^>= 0.19.2
, strict ^>= 0.4.0
, syb ^>= 0.7.2
, text ^>= 1.2.5
, transformers ^>= 0.5.6
, uniplate ^>= 1.6.13
, unsafe ^>= 0.0
, yaml ^>= 0.11.7
}
default-extensions: {
CPP
Expand Down
12 changes: 12 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
packages: .

allow-newer:
, butcher:base
, data-tree-print:base
, multistate:base

-- https://github.com/lspitzner/czipwith/pull/2
source-repository-package
type: git
location: https://github.com/mithrandi/czipwith
tag: b6245884ae83e00dd2b5261762549b37390179f8
6 changes: 3 additions & 3 deletions src-libinterfacetests/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ main = hspec $ do
, " ]"
]
output <- liftIO $ parsePrintModule staticDefaultConfig input
input `shouldSatisfy` \_ -> case output of
Right x | x == expected -> True
_ -> False
hush output `shouldBe` Just expected

hush :: Either a b -> Maybe b
hush = either (const Nothing) Just
91 changes: 91 additions & 0 deletions src-literatetests/10-tests.blt
Original file line number Diff line number Diff line change
Expand Up @@ -1551,6 +1551,97 @@ instance Foo Int where
{ unBarInt :: Int
}

###############################################################################
###############################################################################
###############################################################################
#group gh-357
###############################################################################
###############################################################################
###############################################################################

#test type-instance-without-comment

{-# language TypeFamilies #-}
type family F a
type instance F Int = IO Int

#test type-instance-with-comment

{-# language TypeFamilies #-}
type family F a
type instance F Int = IO Int -- x

#test newtype-instance-without-comment

{-# language TypeFamilies #-}
data family F a
newtype instance F Int = N Int

#test newtype-instance-with-comment

{-# language TypeFamilies #-}
data family F a
newtype instance F Int = N Int -- x

#test data-instance-without-comment

{-# language TypeFamilies #-}
data family F a
data instance F Int = D Int

#test data-instance-with-comment

{-# language TypeFamilies #-}
data family F a
data instance F Int = D Int -- x

#test instance-type-without-comment

{-# language TypeFamilies #-}
class C a where
type family F a
instance C Int where
type F Int = IO Int

#test instance-type-with-comment

{-# language TypeFamilies #-}
class C a where
type family F a
instance C Int where
type F Int = IO Int -- x

#test instance-newtype-without-comment

{-# language TypeFamilies #-}
class C a where
data family F a
instance C Int where
newtype F Int = N Int

#test instance-newtype-with-comment

{-# language TypeFamilies #-}
class C a where
data family F a
instance C Int where
newtype F Int = N Int -- x

#test instance-data-without-comment

{-# language TypeFamilies #-}
class C a where
data family F a
instance C Int where
data F Int = D Int

#test instance-data-with-comment

{-# language TypeFamilies #-}
class C a where
data family F a
instance C Int where
data F Int = D Int -- x

###############################################################################
###############################################################################
Expand Down
Loading