Skip to content

Commit 5ee5096

Browse files
committed
Update to 0.3.0.2
1 parent e8e3cd5 commit 5ee5096

File tree

7 files changed

+216
-72
lines changed

7 files changed

+216
-72
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

.github/workflows/haskell-ci.yml

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
# This GitHub workflow config has been generated by a script via
2+
#
3+
# haskell-ci 'github' 'named.cabal'
4+
#
5+
# To regenerate the script (for example after adjusting tested-with) run
6+
#
7+
# haskell-ci regenerate
8+
#
9+
# For more information, see https://github.com/haskell-CI/haskell-ci
10+
#
11+
# version: 0.19.20240708
12+
#
13+
# REGENDATA ("0.19.20240708",["github","named.cabal"])
14+
#
15+
name: Haskell-CI
16+
on:
17+
- push
18+
- pull_request
19+
jobs:
20+
linux:
21+
name: Haskell-CI - Linux - ${{ matrix.compiler }}
22+
runs-on: ubuntu-20.04
23+
timeout-minutes:
24+
60
25+
container:
26+
image: buildpack-deps:jammy
27+
continue-on-error: ${{ matrix.allow-failure }}
28+
strategy:
29+
matrix:
30+
include:
31+
- compiler: ghc-9.10.1
32+
compilerKind: ghc
33+
compilerVersion: 9.10.1
34+
setup-method: ghcup
35+
allow-failure: false
36+
- compiler: ghc-9.6.6
37+
compilerKind: ghc
38+
compilerVersion: 9.6.6
39+
setup-method: ghcup
40+
allow-failure: false
41+
- compiler: ghc-9.4.8
42+
compilerKind: ghc
43+
compilerVersion: 9.4.8
44+
setup-method: ghcup
45+
allow-failure: false
46+
fail-fast: false
47+
steps:
48+
- name: apt
49+
run: |
50+
apt-get update
51+
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
52+
mkdir -p "$HOME/.ghcup/bin"
53+
curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup"
54+
chmod a+x "$HOME/.ghcup/bin/ghcup"
55+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
56+
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
57+
env:
58+
HCKIND: ${{ matrix.compilerKind }}
59+
HCNAME: ${{ matrix.compiler }}
60+
HCVER: ${{ matrix.compilerVersion }}
61+
- name: Set PATH and environment variables
62+
run: |
63+
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
64+
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
65+
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
66+
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
67+
HCDIR=/opt/$HCKIND/$HCVER
68+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
69+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
70+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
71+
echo "HC=$HC" >> "$GITHUB_ENV"
72+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
73+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
74+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
75+
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
76+
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
77+
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
78+
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
79+
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
80+
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
81+
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
82+
env:
83+
HCKIND: ${{ matrix.compilerKind }}
84+
HCNAME: ${{ matrix.compiler }}
85+
HCVER: ${{ matrix.compilerVersion }}
86+
- name: env
87+
run: |
88+
env
89+
- name: write cabal config
90+
run: |
91+
mkdir -p $CABAL_DIR
92+
cat >> $CABAL_CONFIG <<EOF
93+
remote-build-reporting: anonymous
94+
write-ghc-environment-files: never
95+
remote-repo-cache: $CABAL_DIR/packages
96+
logs-dir: $CABAL_DIR/logs
97+
world-file: $CABAL_DIR/world
98+
extra-prog-path: $CABAL_DIR/bin
99+
symlink-bindir: $CABAL_DIR/bin
100+
installdir: $CABAL_DIR/bin
101+
build-summary: $CABAL_DIR/logs/build.log
102+
store-dir: $CABAL_DIR/store
103+
install-dirs user
104+
prefix: $CABAL_DIR
105+
repository hackage.haskell.org
106+
url: http://hackage.haskell.org/
107+
EOF
108+
cat >> $CABAL_CONFIG <<EOF
109+
program-default-options
110+
ghc-options: $GHCJOBS +RTS -M3G -RTS
111+
EOF
112+
cat $CABAL_CONFIG
113+
- name: versions
114+
run: |
115+
$HC --version || true
116+
$HC --print-project-git-commit-id || true
117+
$CABAL --version || true
118+
- name: update cabal index
119+
run: |
120+
$CABAL v2-update -v
121+
- name: install cabal-plan
122+
run: |
123+
mkdir -p $HOME/.cabal/bin
124+
curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.7.3.0/cabal-plan-0.7.3.0-x86_64-linux.xz > cabal-plan.xz
125+
echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 cabal-plan.xz' | sha256sum -c -
126+
xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
127+
rm -f cabal-plan.xz
128+
chmod a+x $HOME/.cabal/bin/cabal-plan
129+
cabal-plan --version
130+
- name: checkout
131+
uses: actions/checkout@v4
132+
with:
133+
path: source
134+
- name: initial cabal.project for sdist
135+
run: |
136+
touch cabal.project
137+
echo "packages: $GITHUB_WORKSPACE/source/." >> cabal.project
138+
cat cabal.project
139+
- name: sdist
140+
run: |
141+
mkdir -p sdist
142+
$CABAL sdist all --output-dir $GITHUB_WORKSPACE/sdist
143+
- name: unpack
144+
run: |
145+
mkdir -p unpacked
146+
find sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE/unpacked -xzvf {} \;
147+
- name: generate cabal.project
148+
run: |
149+
PKGDIR_named="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/named-[0-9.]*')"
150+
echo "PKGDIR_named=${PKGDIR_named}" >> "$GITHUB_ENV"
151+
rm -f cabal.project cabal.project.local
152+
touch cabal.project
153+
touch cabal.project.local
154+
echo "packages: ${PKGDIR_named}" >> cabal.project
155+
echo "package named" >> cabal.project
156+
echo " ghc-options: -Werror=missing-methods" >> cabal.project
157+
cat >> cabal.project <<EOF
158+
EOF
159+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(named)$/; }' >> cabal.project.local
160+
cat cabal.project
161+
cat cabal.project.local
162+
- name: dump install plan
163+
run: |
164+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
165+
cabal-plan
166+
- name: restore cache
167+
uses: actions/cache/restore@v4
168+
with:
169+
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
170+
path: ~/.cabal/store
171+
restore-keys: ${{ runner.os }}-${{ matrix.compiler }}-
172+
- name: install dependencies
173+
run: |
174+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all
175+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dependencies-only -j2 all
176+
- name: build w/o tests
177+
run: |
178+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
179+
- name: build
180+
run: |
181+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always
182+
- name: tests
183+
run: |
184+
$CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
185+
- name: cabal check
186+
run: |
187+
cd ${PKGDIR_named} || false
188+
${CABAL} -vnormal check
189+
- name: haddock
190+
run: |
191+
$CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
192+
- name: unconstrained build
193+
run: |
194+
rm -f cabal.project.local
195+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
196+
- name: save cache
197+
uses: actions/cache/save@v4
198+
if: always()
199+
with:
200+
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
201+
path: ~/.cabal/store

ChangeLog.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
* Bumped upper bounds for GHC 9.4 and older.
1+
## 0.3.0.2
2+
3+
* Support GHCs 9.4 to 9.10, fix warnings.
24

35
## 0.3.0.1
46

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# `named` – keyword arguments for Haskell
22

3-
[![Build Status](https://github.com/monadfix/named/workflows/CI/badge.svg)](https://github.com/monadfix/named/actions)
43
[![Hackage](https://img.shields.io/hackage/v/named.svg)](https://hackage.haskell.org/package/named)
54

65
`named` is a lightweight library for named function parameters (keyword

named.cabal

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
cabal-version: 2.4
12
name: named
2-
version: 0.3.0.1
3+
version: 0.3.0.2
34
synopsis: Named parameters (keyword arguments) for Haskell
45
description:
56
`named` is a lightweight library for named function parameters (keyword
@@ -28,7 +29,7 @@ description:
2829
> ! #to "/target/path"
2930

3031

31-
license: BSD3
32+
license: BSD-3-Clause
3233
license-file: LICENSE
3334
author: Vladislav Zavialov
3435
maintainer: Monadfix <[email protected]>
@@ -37,28 +38,27 @@ bug-reports: https://github.com/monadfix/named/issues
3738
category: Control
3839
build-type: Simple
3940
extra-source-files: ChangeLog.md
40-
tested-with: GHC ==8.0.2, GHC ==8.2.2, GHC ==8.4.4, GHC ==8.6.5, GHC ==8.8.5, GHC ==9.2.5, GHC ==9.4.4
41-
cabal-version: >=1.10
41+
tested-with: GHC ==9.4.8, GHC ==9.6.6, GHC ==9.10.1
4242

4343
source-repository head
4444
type: git
4545
location: [email protected]:monadfix/named.git
4646

4747
library
4848
exposed-modules: Named, Named.Internal
49-
build-depends: base >=4.9 && <4.18
49+
build-depends: base >=4.16 && <4.21
5050
hs-source-dirs: src
51-
default-language: Haskell2010
51+
default-language: GHC2021
5252
ghc-options: -Wall
5353
-fno-warn-unticked-promoted-constructors
5454

5555
test-suite regression
5656
type: exitcode-stdio-1.0
5757
main-is: Test.hs
5858
other-modules: TestImport
59-
build-depends: base >=4.9 && <4.18,
59+
build-depends: base >=4.16 && <4.21,
6060
named
6161
hs-source-dirs: test
62-
default-language: Haskell2010
62+
default-language: GHC2021
6363
ghc-options: -Wall
6464
-fno-warn-missing-signatures

src/Named/Internal.hs

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
{-# LANGUAGE KindSignatures, DataKinds, FlexibleInstances, FlexibleContexts,
2-
FunctionalDependencies, TypeFamilies, TypeOperators,
3-
PatternSynonyms, UndecidableInstances, ConstraintKinds,
4-
TypeApplications, ScopedTypeVariables, CPP,
5-
AllowAmbiguousTypes #-}
1+
{-# LANGUAGE AllowAmbiguousTypes, DataKinds, ExplicitNamespaces,
2+
FunctionalDependencies, PatternSynonyms, TypeFamilies,
3+
UndecidableInstances #-}
64

75
module Named.Internal where
86

@@ -12,6 +10,7 @@ import Data.Functor.Identity (Identity(..))
1210
import Data.Kind (Type)
1311
import GHC.TypeLits (Symbol, TypeError, ErrorMessage(..))
1412
import GHC.OverloadedLabels (IsLabel(..))
13+
import Data.Type.Equality (type (~))
1514

1615
{- |
1716
@@ -29,10 +28,7 @@ newtype NamedF f (a :: Type) (name :: Symbol) =
2928
-- | Match on an argument without specifying its name. See also: 'arg'.
3029
pattern Arg :: a -> name :! a
3130
pattern Arg a = ArgF (Identity a)
32-
33-
#if MIN_VERSION_base(4,10,0)
3431
{-# COMPLETE Arg #-}
35-
#endif
3632

3733
-- | Infix notation for the type of a named parameter.
3834
type name :! a = NamedF Identity a name
@@ -50,21 +46,13 @@ instance InjValue Maybe where
5046
injValue = Just
5147

5248
instance (name ~ name', a ~ a', InjValue f) => IsLabel name (a -> NamedF f a' name') where
53-
#if MIN_VERSION_base(4,10,0)
5449
fromLabel a = ArgF (injValue a)
55-
#else
56-
fromLabel _ a = ArgF (injValue a)
57-
#endif
5850
{-# INLINE fromLabel #-}
5951

6052
newtype Param p = Param p
6153

6254
instance (p ~ NamedF f a name, InjValue f) => IsLabel name (a -> Param p) where
63-
#if MIN_VERSION_base(4,10,0)
6455
fromLabel a = Param (fromLabel @name a)
65-
#else
66-
fromLabel pName a = Param (fromLabel pName a)
67-
#endif
6856
{-# INLINE fromLabel #-}
6957

7058
{- | Explicitly build a function parameter:
@@ -181,11 +169,7 @@ A proxy for a name, intended for use with @-XOverloadedLabels@:
181169
data Name (name :: Symbol) = Name
182170

183171
instance name ~ name' => IsLabel name' (Name name) where
184-
#if MIN_VERSION_base(4,10,0)
185172
fromLabel = Name
186-
#else
187-
fromLabel _ = Name
188-
#endif
189173
{-# INLINE fromLabel #-}
190174

191175
{- |

stack.yaml

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)