Skip to content

Commit

Permalink
Use quantified constraints in OptionsGrammar
Browse files Browse the repository at this point in the history
  • Loading branch information
phadej committed Jul 1, 2024
1 parent 90e8ffe commit 88bf5fc
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ jobs:
run: |
perl -i -e 'while (<ARGV>) { print unless /package-id\s+(base-compat-batteries|bs-cmpt-bttrs)-\d+(\.\d+)*/; }' .ghc.environment.*
if [ $((HCNUMVER < 90000)) -ne 0 ] ; then cd ${PKGDIR_haskell_ci} || false ; fi
if [ $((HCNUMVER < 90000)) -ne 0 ] ; then doctest --fast -XHaskell2010 -XBangPatterns -XDeriveAnyClass -XDeriveFoldable -XDeriveFunctor -XDeriveGeneric -XDeriveTraversable -XDerivingStrategies -XGeneralizedNewtypeDeriving -XNoImplicitPrelude -XScopedTypeVariables -XTypeOperators src ; fi
if [ $((HCNUMVER < 90000)) -ne 0 ] ; then doctest --fast -XHaskell2010 -XBangPatterns -XConstraintKinds -XDataKinds -XDeriveAnyClass -XDeriveFoldable -XDeriveFunctor -XDeriveGeneric -XDeriveTraversable -XDerivingStrategies -XFlexibleContexts -XFlexibleInstances -XFunctionalDependencies -XGADTs -XGeneralizedNewtypeDeriving -XMultiWayIf -XNoImplicitPrelude -XQuantifiedConstraints -XRankNTypes -XScopedTypeVariables -XTypeApplications -XTypeOperators -XUndecidableInstances -XUndecidableSuperClasses -XViewPatterns src ; fi
if [ $((HCNUMVER < 90000)) -ne 0 ] ; then cd ${PKGDIR_cabal_install_parsers} || false ; fi
if [ $((HCNUMVER < 90000)) -ne 0 ] ; then doctest --fast -XHaskell2010 src ; fi
- name: docspec
Expand Down
53 changes: 34 additions & 19 deletions haskell-ci.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,37 @@ flag ShellCheck
default: True
manual: True

library haskell-ci-internal
common language
default-language: Haskell2010
hs-source-dirs: src
default-extensions:
BangPatterns
ConstraintKinds
DataKinds
DeriveAnyClass
DeriveFoldable
DeriveFunctor
DeriveGeneric
DeriveTraversable
DerivingStrategies
FlexibleContexts
FlexibleInstances
FunctionalDependencies
GADTs
GeneralizedNewtypeDeriving
MultiWayIf
NoImplicitPrelude
QuantifiedConstraints
RankNTypes
ScopedTypeVariables
TypeApplications
TypeOperators
UndecidableInstances
UndecidableSuperClasses
ViewPatterns

library haskell-ci-internal
import: language
hs-source-dirs: src
ghc-options:
-Wall -Wincomplete-uni-patterns -Wincomplete-record-updates
-Wcompat -Wnoncanonical-monad-instances
Expand Down Expand Up @@ -123,19 +151,6 @@ library haskell-ci-internal
HaskellCI.VersionInfo
HaskellCI.YamlSyntax

default-extensions:
BangPatterns
DeriveAnyClass
DeriveFoldable
DeriveFunctor
DeriveGeneric
DeriveTraversable
DerivingStrategies
GeneralizedNewtypeDeriving
NoImplicitPrelude
ScopedTypeVariables
TypeOperators

other-extensions:
CPP
NamedFieldPuns
Expand Down Expand Up @@ -194,10 +209,10 @@ executable haskell-ci
default-language: Haskell2010

test-suite golden
default-language: Haskell2010
type: exitcode-stdio-1.0
main-is: Tests.hs
hs-source-dirs: test
import: language
type: exitcode-stdio-1.0
main-is: Tests.hs
hs-source-dirs: test

-- inherited constraints via lib:haskell-ci
build-depends:
Expand Down
2 changes: 1 addition & 1 deletion haskell-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ run_cmd $CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-detai
put_info "doctest"
run_cmd perl -i -e 'while (<ARGV>) { print unless /package-id\s+(base-compat-batteries|bs-cmpt-bttrs)-\d+(\.\d+)*/; }' .ghc.environment.*
change_dir_if $((HCNUMVER < 90000)) ${PKGDIR_haskell_ci}
run_cmd_if $((HCNUMVER < 90000)) doctest --fast -XHaskell2010 -XBangPatterns -XDeriveAnyClass -XDeriveFoldable -XDeriveFunctor -XDeriveGeneric -XDeriveTraversable -XDerivingStrategies -XGeneralizedNewtypeDeriving -XNoImplicitPrelude -XScopedTypeVariables -XTypeOperators src
run_cmd_if $((HCNUMVER < 90000)) doctest --fast -XHaskell2010 -XBangPatterns -XConstraintKinds -XDataKinds -XDeriveAnyClass -XDeriveFoldable -XDeriveFunctor -XDeriveGeneric -XDeriveTraversable -XDerivingStrategies -XFlexibleContexts -XFlexibleInstances -XFunctionalDependencies -XGADTs -XGeneralizedNewtypeDeriving -XMultiWayIf -XNoImplicitPrelude -XQuantifiedConstraints -XRankNTypes -XScopedTypeVariables -XTypeApplications -XTypeOperators -XUndecidableInstances -XUndecidableSuperClasses -XViewPatterns src
change_dir_if $((HCNUMVER < 90000)) ${PKGDIR_cabal_install_parsers}
run_cmd_if $((HCNUMVER < 90000)) doctest --fast -XHaskell2010 src

Expand Down
10 changes: 3 additions & 7 deletions src/HaskellCI/OptionsGrammar.hs
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE UndecidableSuperClasses #-}
module HaskellCI.OptionsGrammar (
OptionsGrammar (..),
(C.^^^),
Expand Down Expand Up @@ -40,7 +34,9 @@ type BashCompletionAction = String

class
( C.FieldGrammar c p
, c Range, c (Identity C.VersionRange)
, forall s. Applicative (p s)
, forall a. c a => c (Identity a)
, c Range, c C.VersionRange
, c (C.List C.NoCommaFSep C.Token' String)
, c (C.List C.FSep C.Token' String)
, c (AlaSet C.NoCommaFSep C.Token' String)
Expand Down

0 comments on commit 88bf5fc

Please sign in to comment.