Skip to content

Commit 6fe0258

Browse files
authored
Merge pull request #26 from mauke/modernize-cabal
update infrastructure (cabal, github actions)
2 parents b1a0878 + 3d58cce commit 6fe0258

File tree

22 files changed

+530
-360
lines changed

22 files changed

+530
-360
lines changed

.github/workflows/haskell.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Haskell CI
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
build:
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
ghc-version:
14+
- '9.10'
15+
- '9.8'
16+
- '9.6'
17+
- '9.4'
18+
- '9.2'
19+
- '9.0'
20+
- '8.10'
21+
- '8.8'
22+
- '8.6'
23+
- '8.4'
24+
- '8.2'
25+
- '8.0'
26+
os: [ubuntu-latest, windows-latest]
27+
include:
28+
- os: windows-latest
29+
ghc-version: '7.10'
30+
- os: macos-latest
31+
ghc-version: '9.10'
32+
33+
runs-on: ${{matrix.os}}
34+
name: Test w/ ghc ${{matrix.ghc-version}} on ${{matrix.os}}
35+
36+
steps:
37+
- uses: actions/checkout@v4
38+
- uses: haskell-actions/setup@v2
39+
with:
40+
ghc-version: ${{matrix.ghc-version}}
41+
name: set up ghc
42+
id: setup
43+
44+
- name: configure
45+
run: |
46+
cabal configure --enable-tests
47+
cabal build all --dry-run
48+
49+
- name: restore cabal cache
50+
uses: actions/cache/restore@v4
51+
id: cache
52+
env:
53+
key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}
54+
with:
55+
path: ${{ steps.setup.outputs.cabal-store }}
56+
key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }}
57+
restore-keys: ${{ env.key }}-
58+
59+
- name: Install dependencies
60+
# If we had an exact cache hit, the dependencies will be up to date.
61+
if: steps.cache.outputs.cache-hit != 'true'
62+
run: cabal build all --only-dependencies
63+
64+
- name: save cabal cache
65+
uses: actions/cache/save@v4
66+
# If we had an exact cache hit, trying to save the cache would error because of key clash.
67+
if: steps.cache.outputs.cache-hit != 'true'
68+
with:
69+
path: ${{ steps.setup.outputs.cabal-store }}
70+
key: ${{ steps.cache.outputs.cache-primary-key }}
71+
72+
- name: build
73+
run: cabal build all
74+
75+
- name: test
76+
run: cabal test all
77+
78+
- name: check
79+
shell: bash
80+
run: |
81+
for i in */*.cabal; do
82+
( cd "${i%/*}" && cabal check ) || break
83+
done
84+
85+
- name: documentation
86+
run: cabal haddock all

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
*.sw[m-p]
2+
dist-newstyle/
13
*.hi
24
*.o
35
dist/

cabal.project

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
packages: */*.cabal
2+
3+
jobs: $ncpus
4+
5+
program-options
6+
ghc-options: -Wall

data-default-class/Data/Default/Class.hs

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,35 @@
11
{-
22
3-
Copyright (c) 2013 Lukas Mai
3+
Copyright (c) 2013, Lukas Mai
44
55
All rights reserved.
66
7-
Redistribution and use in source and binary forms, with or without modification,
8-
are permitted provided that the following conditions are met:
9-
10-
* Redistributions of source code must retain the above copyright notice, this
11-
list of conditions and the following disclaimer.
12-
* Redistributions in binary form must reproduce the above copyright notice,
13-
this list of conditions and the following disclaimer in the documentation
14-
and/or other materials provided with the distribution.
15-
* Neither the name of the author nor the names of his contributors
16-
may be used to endorse or promote products derived from this software
17-
without specific prior written permission.
18-
19-
THIS SOFTWARE IS PROVIDED BY LUKAS MAI AND CONTRIBUTORS "AS IS" AND ANY
20-
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21-
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22-
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
23-
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24-
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25-
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
26-
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7+
Redistribution and use in source and binary forms, with or without
8+
modification, are permitted provided that the following conditions are met:
9+
10+
* Redistributions of source code must retain the above copyright
11+
notice, this list of conditions and the following disclaimer.
12+
13+
* Redistributions in binary form must reproduce the above
14+
copyright notice, this list of conditions and the following
15+
disclaimer in the documentation and/or other materials provided
16+
with the distribution.
17+
18+
* Neither the name of Lukas Mai nor the names of other
19+
contributors may be used to endorse or promote products derived
20+
from this software without specific prior written permission.
21+
22+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2933
3034
-}
3135

data-default-class/LICENSE

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
1-
Copyright (c) 2013 Lukas Mai
1+
Copyright (c) 2013, Lukas Mai
22

33
All rights reserved.
44

5-
Redistribution and use in source and binary forms, with or without modification,
6-
are permitted provided that the following conditions are met:
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions are met:
77

8-
* Redistributions of source code must retain the above copyright notice, this
9-
list of conditions and the following disclaimer.
10-
* Redistributions in binary form must reproduce the above copyright notice,
11-
this list of conditions and the following disclaimer in the documentation
12-
and/or other materials provided with the distribution.
13-
* Neither the name of the author nor the names of his contributors
14-
may be used to endorse or promote products derived from this software
15-
without specific prior written permission.
8+
* Redistributions of source code must retain the above copyright
9+
notice, this list of conditions and the following disclaimer.
1610

17-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18-
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19-
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE
21-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
11+
* Redistributions in binary form must reproduce the above
12+
copyright notice, this list of conditions and the following
13+
disclaimer in the documentation and/or other materials provided
14+
with the distribution.
15+
16+
* Neither the name of Lukas Mai nor the names of other
17+
contributors may be used to endorse or promote products derived
18+
from this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2630
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
1-
Name: data-default-class
2-
Version: 0.1.2.0
3-
Cabal-Version: >= 1.6
4-
Category: Data
5-
Synopsis: A class for types with a default value
6-
Build-Type: Simple
7-
License: BSD3
8-
License-File: LICENSE
9-
Author: Lukas Mai
10-
Maintainer: <[email protected]>
1+
cabal-version: 3.0
2+
name: data-default-class
3+
version: 0.1.2.0
4+
category: Data
5+
synopsis: A class for types with a default value
6+
build-type: Simple
7+
license: BSD-3-Clause
8+
license-file: LICENSE
9+
copyright: (c) 2013 Lukas Mai
10+
author: Lukas Mai
11+
maintainer: <[email protected]>
1112

1213
source-repository head
13-
type: git
14-
location: https://github.com/mauke/data-default
14+
type: git
15+
location: https://github.com/mauke/data-default
1516

16-
Library
17-
Build-Depends: base >=2 && <5
18-
if impl(ghc == 7.4.*)
19-
-- for GHC.Generics
20-
Build-Depends: ghc-prim
21-
Exposed-Modules: Data.Default.Class
17+
library
18+
build-depends: base >=2 && <5
19+
if impl(ghc == 7.4.*)
20+
-- for GHC.Generics
21+
build-depends: ghc-prim
22+
exposed-modules: Data.Default.Class
23+
default-language: Haskell98

data-default-instances-base/Data/Default/Instances/Base.hs

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,35 @@
11
{-
22
3-
Copyright (c) 2013 Lukas Mai
3+
Copyright (c) 2013, Lukas Mai
44
55
All rights reserved.
66
7-
Redistribution and use in source and binary forms, with or without modification,
8-
are permitted provided that the following conditions are met:
9-
10-
* Redistributions of source code must retain the above copyright notice, this
11-
list of conditions and the following disclaimer.
12-
* Redistributions in binary form must reproduce the above copyright notice,
13-
this list of conditions and the following disclaimer in the documentation
14-
and/or other materials provided with the distribution.
15-
* Neither the name of the author nor the names of his contributors
16-
may be used to endorse or promote products derived from this software
17-
without specific prior written permission.
18-
19-
THIS SOFTWARE IS PROVIDED BY LUKAS MAI AND CONTRIBUTORS "AS IS" AND ANY
20-
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21-
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22-
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
23-
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24-
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25-
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
26-
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7+
Redistribution and use in source and binary forms, with or without
8+
modification, are permitted provided that the following conditions are met:
9+
10+
* Redistributions of source code must retain the above copyright
11+
notice, this list of conditions and the following disclaimer.
12+
13+
* Redistributions in binary form must reproduce the above
14+
copyright notice, this list of conditions and the following
15+
disclaimer in the documentation and/or other materials provided
16+
with the distribution.
17+
18+
* Neither the name of Lukas Mai nor the names of other
19+
contributors may be used to endorse or promote products derived
20+
from this software without specific prior written permission.
21+
22+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2933
3034
-}
3135

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
1-
Copyright (c) 2013 Lukas Mai
1+
Copyright (c) 2013, Lukas Mai
22

33
All rights reserved.
44

5-
Redistribution and use in source and binary forms, with or without modification,
6-
are permitted provided that the following conditions are met:
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions are met:
77

8-
* Redistributions of source code must retain the above copyright notice, this
9-
list of conditions and the following disclaimer.
10-
* Redistributions in binary form must reproduce the above copyright notice,
11-
this list of conditions and the following disclaimer in the documentation
12-
and/or other materials provided with the distribution.
13-
* Neither the name of the author nor the names of his contributors
14-
may be used to endorse or promote products derived from this software
15-
without specific prior written permission.
8+
* Redistributions of source code must retain the above copyright
9+
notice, this list of conditions and the following disclaimer.
1610

17-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18-
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19-
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE
21-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
11+
* Redistributions in binary form must reproduce the above
12+
copyright notice, this list of conditions and the following
13+
disclaimer in the documentation and/or other materials provided
14+
with the distribution.
15+
16+
* Neither the name of Lukas Mai nor the names of other
17+
contributors may be used to endorse or promote products derived
18+
from this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2630
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
Name: data-default-instances-base
2-
Version: 0.1.0.1
3-
Cabal-Version: >= 1.6
4-
Category: Data
5-
Synopsis: Default instances for types in base
6-
Build-Type: Simple
7-
License: BSD3
8-
License-File: LICENSE
9-
Author: Lukas Mai
10-
Maintainer: <[email protected]>
1+
cabal-version: 3.0
2+
name: data-default-instances-base
3+
version: 0.1.0.1
4+
category: Data
5+
synopsis: Default instances for types in base
6+
build-type: Simple
7+
license: BSD-3-Clause
8+
license-file: LICENSE
9+
copyright: (c) 2013 Lukas Mai
10+
author: Lukas Mai
11+
maintainer: <[email protected]>
1112

1213
source-repository head
13-
type: git
14-
location: https://github.com/mauke/data-default
14+
type: git
15+
location: https://github.com/mauke/data-default
1516

16-
Library
17-
Build-Depends: base >=2 && <5, data-default-class >=0.1.2.0
18-
Exposed-Modules: Data.Default.Instances.Base
17+
library
18+
build-depends: base >=2 && <5, data-default-class ^>=0.1.2.0
19+
exposed-modules: Data.Default.Instances.Base
20+
default-language: Haskell98

0 commit comments

Comments
 (0)