[arch-commits] Commit in cabal-fmt/repos/community-staging-x86_64 (4 files)
Felix Yan
felixonmars at gemini.archlinux.org
Tue Oct 12 10:18:54 UTC 2021
Date: Tuesday, October 12, 2021 @ 10:18:53
Author: felixonmars
Revision: 1029760
archrelease: copy trunk to community-staging-x86_64
Added:
cabal-fmt/repos/community-staging-x86_64/PKGBUILD
(from rev 1029759, cabal-fmt/trunk/PKGBUILD)
cabal-fmt/repos/community-staging-x86_64/cabal-fmt-cabal-3.4.patch
(from rev 1029759, cabal-fmt/trunk/cabal-fmt-cabal-3.4.patch)
Deleted:
cabal-fmt/repos/community-staging-x86_64/PKGBUILD
cabal-fmt/repos/community-staging-x86_64/cabal-fmt-cabal-3.4.patch
---------------------------+
PKGBUILD | 106 ++++-----
cabal-fmt-cabal-3.4.patch | 468 ++++++++++++++++++++++----------------------
2 files changed, 287 insertions(+), 287 deletions(-)
Deleted: PKGBUILD
===================================================================
--- PKGBUILD 2021-10-12 10:18:43 UTC (rev 1029759)
+++ PKGBUILD 2021-10-12 10:18:53 UTC (rev 1029760)
@@ -1,53 +0,0 @@
-# Maintainer: Felix Yan <felixonmars at archlinux.org>
-
-pkgname=cabal-fmt
-pkgver=0.1.5.1
-pkgrel=11
-pkgdesc="Format .cabal files"
-url="https://github.com/phadej/cabal-fmt.git"
-license=("GPL" "BSD")
-arch=('x86_64')
-depends=('ghc-libs' 'haskell-optparse-applicative')
-makedepends=('ghc' 'uusi' 'haskell-tasty' 'haskell-tasty-golden')
-source=("https://hackage.haskell.org/packages/archive/$pkgname/$pkgver/$pkgname-$pkgver.tar.gz"
- cabal-fmt-cabal-3.4.patch)
-sha256sums=('a7fc6f0ff8b36ddd329b01237c0e9a6eda835be9439e434470d69a4511611f7d'
- 'fb74dd7cfc650ed09f763bd11e929a9bd192447df9b55f2b13fd5c3f2a5fa102')
-
-prepare() {
- cd $pkgname-$pkgver
- patch -p1 -i ../cabal-fmt-cabal-3.4.patch
- gen-setup
- uusi -u base $pkgname.cabal
-}
-
-build() {
- cd $pkgname-$pkgver
-
- runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
- --prefix=/usr --docdir=/usr/share/doc/$pkgname --enable-tests \
- --dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid --ghc-option=-fllvm \
- --ghc-option=-optl-Wl\,-z\,relro\,-z\,now \
- --ghc-option='-pie'
-
- runhaskell Setup build $MAKEFLAGS
- runhaskell Setup register --gen-script
- runhaskell Setup unregister --gen-script
- sed -i -r -e "s|ghc-pkg.*update[^ ]* |&'--force' |" register.sh
- sed -i -r -e "s|ghc-pkg.*unregister[^ ]* |&'--force' |" unregister.sh
-}
-
-check() {
- cd $pkgname-$pkgver
- runhaskell Setup test --show-details=direct
-}
-
-package() {
- cd $pkgname-$pkgver
-
- install -D -m744 register.sh "$pkgdir"/usr/share/haskell/register/$pkgname.sh
- install -D -m744 unregister.sh "$pkgdir"/usr/share/haskell/unregister/$pkgname.sh
- runhaskell Setup copy --destdir="$pkgdir"
- install -D -m644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
- rm -f "$pkgdir"/usr/share/doc/$pkgname/LICENSE
-}
Copied: cabal-fmt/repos/community-staging-x86_64/PKGBUILD (from rev 1029759, cabal-fmt/trunk/PKGBUILD)
===================================================================
--- PKGBUILD (rev 0)
+++ PKGBUILD 2021-10-12 10:18:53 UTC (rev 1029760)
@@ -0,0 +1,53 @@
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+
+pkgname=cabal-fmt
+pkgver=0.1.5.1
+pkgrel=12
+pkgdesc="Format .cabal files"
+url="https://github.com/phadej/cabal-fmt.git"
+license=("GPL" "BSD")
+arch=('x86_64')
+depends=('ghc-libs' 'haskell-optparse-applicative')
+makedepends=('ghc' 'uusi' 'haskell-tasty' 'haskell-tasty-golden')
+source=("https://hackage.haskell.org/packages/archive/$pkgname/$pkgver/$pkgname-$pkgver.tar.gz"
+ cabal-fmt-cabal-3.4.patch)
+sha256sums=('a7fc6f0ff8b36ddd329b01237c0e9a6eda835be9439e434470d69a4511611f7d'
+ 'fb74dd7cfc650ed09f763bd11e929a9bd192447df9b55f2b13fd5c3f2a5fa102')
+
+prepare() {
+ cd $pkgname-$pkgver
+ patch -p1 -i ../cabal-fmt-cabal-3.4.patch
+ gen-setup
+ uusi -u base $pkgname.cabal
+}
+
+build() {
+ cd $pkgname-$pkgver
+
+ runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
+ --prefix=/usr --docdir=/usr/share/doc/$pkgname --enable-tests \
+ --dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid --ghc-option=-fllvm \
+ --ghc-option=-optl-Wl\,-z\,relro\,-z\,now \
+ --ghc-option='-pie'
+
+ runhaskell Setup build $MAKEFLAGS
+ runhaskell Setup register --gen-script
+ runhaskell Setup unregister --gen-script
+ sed -i -r -e "s|ghc-pkg.*update[^ ]* |&'--force' |" register.sh
+ sed -i -r -e "s|ghc-pkg.*unregister[^ ]* |&'--force' |" unregister.sh
+}
+
+check() {
+ cd $pkgname-$pkgver
+ runhaskell Setup test --show-details=direct
+}
+
+package() {
+ cd $pkgname-$pkgver
+
+ install -D -m744 register.sh "$pkgdir"/usr/share/haskell/register/$pkgname.sh
+ install -D -m744 unregister.sh "$pkgdir"/usr/share/haskell/unregister/$pkgname.sh
+ runhaskell Setup copy --destdir="$pkgdir"
+ install -D -m644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
+ rm -f "$pkgdir"/usr/share/doc/$pkgname/LICENSE
+}
Deleted: cabal-fmt-cabal-3.4.patch
===================================================================
--- cabal-fmt-cabal-3.4.patch 2021-10-12 10:18:43 UTC (rev 1029759)
+++ cabal-fmt-cabal-3.4.patch 2021-10-12 10:18:53 UTC (rev 1029760)
@@ -1,234 +0,0 @@
-From 842630f70adb5397245109f77dba07662836e964 Mon Sep 17 00:00:00 2001
-From: Oleg Grenrus <oleg.grenrus at iki.fi>
-Date: Mon, 15 Feb 2021 00:52:40 +0200
-Subject: [PATCH 1/2] Move to Cabal-3.4
-
----
- cabal-fmt.cabal | 2 +-
- fixtures/simple-example.format | 2 +-
- src/CabalFmt.hs | 17 +++++++----------
- src/CabalFmt/Fields.hs | 8 +++++++-
- src/CabalFmt/Fields/BuildDepends.hs | 4 ++--
- src/CabalFmt/Fields/Extensions.hs | 12 ++++++------
- src/CabalFmt/Fields/Modules.hs | 12 ++++++------
- src/CabalFmt/Fields/SourceFiles.hs | 10 +++++-----
- src/CabalFmt/Fields/TestedWith.hs | 2 +-
- 9 files changed, 36 insertions(+), 33 deletions(-)
-
-diff --git a/cabal-fmt.cabal b/cabal-fmt.cabal
-index 3f73769..5f0ef0e 100644
---- a/cabal-fmt.cabal
-+++ b/cabal-fmt.cabal
-@@ -30,7 +30,7 @@ library cabal-fmt-internal
- build-depends:
- , base ^>=4.11.1.0 || ^>=4.12.0.0 || ^>=4.13.0.0 || ^>=4.14.0.0
- , bytestring ^>=0.10.8.2
-- , Cabal ^>=3.2.0.0
-+ , Cabal ^>=3.4.0.0
- , containers ^>=0.5.11.0 || ^>=0.6.0.1
- , directory ^>=1.3.1.5
- , filepath ^>=1.4.2
-diff --git a/fixtures/simple-example.format b/fixtures/simple-example.format
-index 37d96b0..d821c88 100644
---- a/fixtures/simple-example.format
-+++ b/fixtures/simple-example.format
-@@ -66,7 +66,7 @@ library
- , pretty
-
- -- only upper bound
-- build-depends: foo ==0.*
-+ build-depends: foo <1
- build-depends: foo <2
- build-depends:
- abc <1
-diff --git a/src/CabalFmt.hs b/src/CabalFmt.hs
-index 7742bc6..f95f175 100644
---- a/src/CabalFmt.hs
-+++ b/src/CabalFmt.hs
-@@ -27,7 +27,6 @@ import qualified Distribution.Types.Condition as C
- import qualified Distribution.Types.ConfVar as C
- import qualified Distribution.Types.GenericPackageDescription as C
- import qualified Distribution.Types.PackageDescription as C
--import qualified Distribution.Types.Version as C
- import qualified Distribution.Types.VersionRange as C
- import qualified Text.PrettyPrint as PP
-
-@@ -79,9 +78,7 @@ cabalFmt filepath contents = do
- False -> return C.cabalSpecLatest
- True -> do
- gpd <- parseGpd filepath contents
-- return $ C.cabalSpecFromVersionDigits
-- $ C.versionNumbers
-- $ C.specVersion
-+ return $ C.specVersion
- $ C.packageDescription gpd
-
- local (over options $ \o -> runOptionsMorphism optsEndo $ o { optSpecVersion = csv }) $ do
-@@ -93,7 +90,7 @@ cabalFmt filepath contents = do
- prettySectionArgs
- inputFields
-
-- return $ C.showFields' fromComments indentWith outputPrettyFields
-+ return $ C.showFields' fromComments (const id) indentWith outputPrettyFields
- & if nullComments endComments then id else
- (++ unlines ("" : [ C.fromUTF8BS c | c <- unComments endComments ]))
-
-@@ -158,12 +155,12 @@ ppCondition (C.COr c1 c2) = PP.parens (PP.hsep [ppCondition c1, PP.text "||", p
- ppCondition (C.CAnd c1 c2) = PP.parens (PP.hsep [ppCondition c1, PP.text "&&", ppCondition c2])
-
- ppConfVar :: C.ConfVar -> PP.Doc
--ppConfVar (C.OS os) = PP.text "os" PP.<> PP.parens (C.pretty os)
--ppConfVar (C.Arch arch) = PP.text "arch" PP.<> PP.parens (C.pretty arch)
--ppConfVar (C.Flag name) = PP.text "flag" PP.<> PP.parens (C.pretty name)
-+ppConfVar (C.OS os) = PP.text "os" PP.<> PP.parens (C.pretty os)
-+ppConfVar (C.Arch arch) = PP.text "arch" PP.<> PP.parens (C.pretty arch)
-+ppConfVar (C.PackageFlag name) = PP.text "flag" PP.<> PP.parens (C.pretty name)
- ppConfVar (C.Impl c v)
-- | v == C.anyVersion = PP.text "impl" PP.<> PP.parens (C.pretty c)
-- | otherwise = PP.text "impl" PP.<> PP.parens (C.pretty c PP.<+> C.pretty v)
-+ | v == C.anyVersion = PP.text "impl" PP.<> PP.parens (C.pretty c)
-+ | otherwise = PP.text "impl" PP.<> PP.parens (C.pretty c PP.<+> C.pretty v)
-
- -------------------------------------------------------------------------------
- -- Pragma to OM
-diff --git a/src/CabalFmt/Fields.hs b/src/CabalFmt/Fields.hs
-index 474e031..7c58031 100644
---- a/src/CabalFmt/Fields.hs
-+++ b/src/CabalFmt/Fields.hs
-@@ -3,7 +3,10 @@
- -- Copyright: Oleg Grenrus
- {-# LANGUAGE DeriveFunctor #-}
- {-# LANGUAGE ExistentialQuantification #-}
-+{-# LANGUAGE FlexibleInstances #-}
-+{-# LANGUAGE MultiParamTypeClasses #-}
- {-# LANGUAGE RankNTypes #-}
-+{-# LANGUAGE UndecidableInstances #-}
- module CabalFmt.Fields (
- FieldDescrs,
- fieldDescrLookup,
-@@ -69,7 +72,7 @@ singletonF
- -> FieldDescrs s a
- singletonF fn f g = F $ Map.singleton fn (SP f g)
-
--instance C.FieldGrammar FieldDescrs where
-+instance C.FieldGrammar PrettyParsec FieldDescrs where
- blurFieldGrammar _ (F m) = F m
-
- booleanFieldDef fn _ _def = singletonF fn f C.parsec where
-@@ -109,3 +112,6 @@ instance C.FieldGrammar FieldDescrs where
- removedIn _ _ x = x
- availableSince _ _ = id
- hiddenField _ = F mempty
-+
-+class (C.Pretty a, C.Parsec a) => PrettyParsec a
-+instance (C.Pretty a, C.Parsec a) => PrettyParsec a
-diff --git a/src/CabalFmt/Fields/BuildDepends.hs b/src/CabalFmt/Fields/BuildDepends.hs
-index 7acb1e0..16fa840 100644
---- a/src/CabalFmt/Fields/BuildDepends.hs
-+++ b/src/CabalFmt/Fields/BuildDepends.hs
-@@ -8,8 +8,8 @@ module CabalFmt.Fields.BuildDepends (
- ) where
-
- import qualified Distribution.CabalSpecVersion as C
-+import qualified Distribution.FieldGrammar as C
- import qualified Distribution.Parsec as C
--import qualified Distribution.Parsec.Newtypes as C
- import qualified Distribution.Pretty as C
- import qualified Distribution.Types.Dependency as C
- import qualified Distribution.Types.DependencyMap as C
-@@ -19,9 +19,9 @@ import qualified Distribution.Types.VersionInterval as C
- import qualified Distribution.Types.VersionRange as C
- import qualified Text.PrettyPrint as PP
-
--import CabalFmt.Prelude
- import CabalFmt.Fields
- import CabalFmt.Options
-+import CabalFmt.Prelude
-
- setupDependsF :: Options -> FieldDescrs () ()
- setupDependsF opts = singletonF "setup-depends" (pretty opts) parse
-diff --git a/src/CabalFmt/Fields/Extensions.hs b/src/CabalFmt/Fields/Extensions.hs
-index b41a7ad..646c0c1 100644
---- a/src/CabalFmt/Fields/Extensions.hs
-+++ b/src/CabalFmt/Fields/Extensions.hs
-@@ -7,14 +7,14 @@ module CabalFmt.Fields.Extensions (
- defaultExtensionsF,
- ) where
-
--import qualified Distribution.Parsec as C
--import qualified Distribution.Parsec.Newtypes as C
--import qualified Distribution.Pretty as C
--import qualified Language.Haskell.Extension as C
--import qualified Text.PrettyPrint as PP
-+import qualified Distribution.FieldGrammar as C
-+import qualified Distribution.Parsec as C
-+import qualified Distribution.Pretty as C
-+import qualified Language.Haskell.Extension as C
-+import qualified Text.PrettyPrint as PP
-
--import CabalFmt.Prelude
- import CabalFmt.Fields
-+import CabalFmt.Prelude
-
- otherExtensionsF :: FieldDescrs () ()
- otherExtensionsF = singletonF "other-extensions" pretty parse
-diff --git a/src/CabalFmt/Fields/Modules.hs b/src/CabalFmt/Fields/Modules.hs
-index 7309f4a..1f6b141 100644
---- a/src/CabalFmt/Fields/Modules.hs
-+++ b/src/CabalFmt/Fields/Modules.hs
-@@ -7,14 +7,14 @@ module CabalFmt.Fields.Modules (
- exposedModulesF,
- ) where
-
--import qualified Distribution.ModuleName as C
--import qualified Distribution.Parsec as C
--import qualified Distribution.Parsec.Newtypes as C
--import qualified Distribution.Pretty as C
--import qualified Text.PrettyPrint as PP
-+import qualified Distribution.FieldGrammar as C
-+import qualified Distribution.ModuleName as C
-+import qualified Distribution.Parsec as C
-+import qualified Distribution.Pretty as C
-+import qualified Text.PrettyPrint as PP
-
--import CabalFmt.Prelude
- import CabalFmt.Fields
-+import CabalFmt.Prelude
-
- exposedModulesF :: FieldDescrs () ()
- exposedModulesF = singletonF "exposed-modules" pretty parse
-diff --git a/src/CabalFmt/Fields/SourceFiles.hs b/src/CabalFmt/Fields/SourceFiles.hs
-index fd8cf1a..a387640 100644
---- a/src/CabalFmt/Fields/SourceFiles.hs
-+++ b/src/CabalFmt/Fields/SourceFiles.hs
-@@ -9,11 +9,11 @@ module CabalFmt.Fields.SourceFiles (
-
- import System.FilePath.Posix (splitDirectories)
-
--import qualified Distribution.Fields as C
--import qualified Distribution.Parsec as C
--import qualified Distribution.Parsec.Newtypes as C
--import qualified Distribution.Pretty as C
--import qualified Text.PrettyPrint as PP
-+import qualified Distribution.FieldGrammar as C
-+import qualified Distribution.Fields as C
-+import qualified Distribution.Parsec as C
-+import qualified Distribution.Pretty as C
-+import qualified Text.PrettyPrint as PP
-
- import CabalFmt.Fields
- import CabalFmt.Prelude
-diff --git a/src/CabalFmt/Fields/TestedWith.hs b/src/CabalFmt/Fields/TestedWith.hs
-index 333f8ca..4217300 100644
---- a/src/CabalFmt/Fields/TestedWith.hs
-+++ b/src/CabalFmt/Fields/TestedWith.hs
-@@ -12,7 +12,7 @@ import qualified Data.Set as Set
- import qualified Distribution.CabalSpecVersion as C
- import qualified Distribution.Compiler as C
- import qualified Distribution.Parsec as C
--import qualified Distribution.Parsec.Newtypes as C
-+import qualified Distribution.FieldGrammar as C
- import qualified Distribution.Pretty as C
- import qualified Distribution.Version as C
- import qualified Text.PrettyPrint as PP
-
Copied: cabal-fmt/repos/community-staging-x86_64/cabal-fmt-cabal-3.4.patch (from rev 1029759, cabal-fmt/trunk/cabal-fmt-cabal-3.4.patch)
===================================================================
--- cabal-fmt-cabal-3.4.patch (rev 0)
+++ cabal-fmt-cabal-3.4.patch 2021-10-12 10:18:53 UTC (rev 1029760)
@@ -0,0 +1,234 @@
+From 842630f70adb5397245109f77dba07662836e964 Mon Sep 17 00:00:00 2001
+From: Oleg Grenrus <oleg.grenrus at iki.fi>
+Date: Mon, 15 Feb 2021 00:52:40 +0200
+Subject: [PATCH 1/2] Move to Cabal-3.4
+
+---
+ cabal-fmt.cabal | 2 +-
+ fixtures/simple-example.format | 2 +-
+ src/CabalFmt.hs | 17 +++++++----------
+ src/CabalFmt/Fields.hs | 8 +++++++-
+ src/CabalFmt/Fields/BuildDepends.hs | 4 ++--
+ src/CabalFmt/Fields/Extensions.hs | 12 ++++++------
+ src/CabalFmt/Fields/Modules.hs | 12 ++++++------
+ src/CabalFmt/Fields/SourceFiles.hs | 10 +++++-----
+ src/CabalFmt/Fields/TestedWith.hs | 2 +-
+ 9 files changed, 36 insertions(+), 33 deletions(-)
+
+diff --git a/cabal-fmt.cabal b/cabal-fmt.cabal
+index 3f73769..5f0ef0e 100644
+--- a/cabal-fmt.cabal
++++ b/cabal-fmt.cabal
+@@ -30,7 +30,7 @@ library cabal-fmt-internal
+ build-depends:
+ , base ^>=4.11.1.0 || ^>=4.12.0.0 || ^>=4.13.0.0 || ^>=4.14.0.0
+ , bytestring ^>=0.10.8.2
+- , Cabal ^>=3.2.0.0
++ , Cabal ^>=3.4.0.0
+ , containers ^>=0.5.11.0 || ^>=0.6.0.1
+ , directory ^>=1.3.1.5
+ , filepath ^>=1.4.2
+diff --git a/fixtures/simple-example.format b/fixtures/simple-example.format
+index 37d96b0..d821c88 100644
+--- a/fixtures/simple-example.format
++++ b/fixtures/simple-example.format
+@@ -66,7 +66,7 @@ library
+ , pretty
+
+ -- only upper bound
+- build-depends: foo ==0.*
++ build-depends: foo <1
+ build-depends: foo <2
+ build-depends:
+ abc <1
+diff --git a/src/CabalFmt.hs b/src/CabalFmt.hs
+index 7742bc6..f95f175 100644
+--- a/src/CabalFmt.hs
++++ b/src/CabalFmt.hs
+@@ -27,7 +27,6 @@ import qualified Distribution.Types.Condition as C
+ import qualified Distribution.Types.ConfVar as C
+ import qualified Distribution.Types.GenericPackageDescription as C
+ import qualified Distribution.Types.PackageDescription as C
+-import qualified Distribution.Types.Version as C
+ import qualified Distribution.Types.VersionRange as C
+ import qualified Text.PrettyPrint as PP
+
+@@ -79,9 +78,7 @@ cabalFmt filepath contents = do
+ False -> return C.cabalSpecLatest
+ True -> do
+ gpd <- parseGpd filepath contents
+- return $ C.cabalSpecFromVersionDigits
+- $ C.versionNumbers
+- $ C.specVersion
++ return $ C.specVersion
+ $ C.packageDescription gpd
+
+ local (over options $ \o -> runOptionsMorphism optsEndo $ o { optSpecVersion = csv }) $ do
+@@ -93,7 +90,7 @@ cabalFmt filepath contents = do
+ prettySectionArgs
+ inputFields
+
+- return $ C.showFields' fromComments indentWith outputPrettyFields
++ return $ C.showFields' fromComments (const id) indentWith outputPrettyFields
+ & if nullComments endComments then id else
+ (++ unlines ("" : [ C.fromUTF8BS c | c <- unComments endComments ]))
+
+@@ -158,12 +155,12 @@ ppCondition (C.COr c1 c2) = PP.parens (PP.hsep [ppCondition c1, PP.text "||", p
+ ppCondition (C.CAnd c1 c2) = PP.parens (PP.hsep [ppCondition c1, PP.text "&&", ppCondition c2])
+
+ ppConfVar :: C.ConfVar -> PP.Doc
+-ppConfVar (C.OS os) = PP.text "os" PP.<> PP.parens (C.pretty os)
+-ppConfVar (C.Arch arch) = PP.text "arch" PP.<> PP.parens (C.pretty arch)
+-ppConfVar (C.Flag name) = PP.text "flag" PP.<> PP.parens (C.pretty name)
++ppConfVar (C.OS os) = PP.text "os" PP.<> PP.parens (C.pretty os)
++ppConfVar (C.Arch arch) = PP.text "arch" PP.<> PP.parens (C.pretty arch)
++ppConfVar (C.PackageFlag name) = PP.text "flag" PP.<> PP.parens (C.pretty name)
+ ppConfVar (C.Impl c v)
+- | v == C.anyVersion = PP.text "impl" PP.<> PP.parens (C.pretty c)
+- | otherwise = PP.text "impl" PP.<> PP.parens (C.pretty c PP.<+> C.pretty v)
++ | v == C.anyVersion = PP.text "impl" PP.<> PP.parens (C.pretty c)
++ | otherwise = PP.text "impl" PP.<> PP.parens (C.pretty c PP.<+> C.pretty v)
+
+ -------------------------------------------------------------------------------
+ -- Pragma to OM
+diff --git a/src/CabalFmt/Fields.hs b/src/CabalFmt/Fields.hs
+index 474e031..7c58031 100644
+--- a/src/CabalFmt/Fields.hs
++++ b/src/CabalFmt/Fields.hs
+@@ -3,7 +3,10 @@
+ -- Copyright: Oleg Grenrus
+ {-# LANGUAGE DeriveFunctor #-}
+ {-# LANGUAGE ExistentialQuantification #-}
++{-# LANGUAGE FlexibleInstances #-}
++{-# LANGUAGE MultiParamTypeClasses #-}
+ {-# LANGUAGE RankNTypes #-}
++{-# LANGUAGE UndecidableInstances #-}
+ module CabalFmt.Fields (
+ FieldDescrs,
+ fieldDescrLookup,
+@@ -69,7 +72,7 @@ singletonF
+ -> FieldDescrs s a
+ singletonF fn f g = F $ Map.singleton fn (SP f g)
+
+-instance C.FieldGrammar FieldDescrs where
++instance C.FieldGrammar PrettyParsec FieldDescrs where
+ blurFieldGrammar _ (F m) = F m
+
+ booleanFieldDef fn _ _def = singletonF fn f C.parsec where
+@@ -109,3 +112,6 @@ instance C.FieldGrammar FieldDescrs where
+ removedIn _ _ x = x
+ availableSince _ _ = id
+ hiddenField _ = F mempty
++
++class (C.Pretty a, C.Parsec a) => PrettyParsec a
++instance (C.Pretty a, C.Parsec a) => PrettyParsec a
+diff --git a/src/CabalFmt/Fields/BuildDepends.hs b/src/CabalFmt/Fields/BuildDepends.hs
+index 7acb1e0..16fa840 100644
+--- a/src/CabalFmt/Fields/BuildDepends.hs
++++ b/src/CabalFmt/Fields/BuildDepends.hs
+@@ -8,8 +8,8 @@ module CabalFmt.Fields.BuildDepends (
+ ) where
+
+ import qualified Distribution.CabalSpecVersion as C
++import qualified Distribution.FieldGrammar as C
+ import qualified Distribution.Parsec as C
+-import qualified Distribution.Parsec.Newtypes as C
+ import qualified Distribution.Pretty as C
+ import qualified Distribution.Types.Dependency as C
+ import qualified Distribution.Types.DependencyMap as C
+@@ -19,9 +19,9 @@ import qualified Distribution.Types.VersionInterval as C
+ import qualified Distribution.Types.VersionRange as C
+ import qualified Text.PrettyPrint as PP
+
+-import CabalFmt.Prelude
+ import CabalFmt.Fields
+ import CabalFmt.Options
++import CabalFmt.Prelude
+
+ setupDependsF :: Options -> FieldDescrs () ()
+ setupDependsF opts = singletonF "setup-depends" (pretty opts) parse
+diff --git a/src/CabalFmt/Fields/Extensions.hs b/src/CabalFmt/Fields/Extensions.hs
+index b41a7ad..646c0c1 100644
+--- a/src/CabalFmt/Fields/Extensions.hs
++++ b/src/CabalFmt/Fields/Extensions.hs
+@@ -7,14 +7,14 @@ module CabalFmt.Fields.Extensions (
+ defaultExtensionsF,
+ ) where
+
+-import qualified Distribution.Parsec as C
+-import qualified Distribution.Parsec.Newtypes as C
+-import qualified Distribution.Pretty as C
+-import qualified Language.Haskell.Extension as C
+-import qualified Text.PrettyPrint as PP
++import qualified Distribution.FieldGrammar as C
++import qualified Distribution.Parsec as C
++import qualified Distribution.Pretty as C
++import qualified Language.Haskell.Extension as C
++import qualified Text.PrettyPrint as PP
+
+-import CabalFmt.Prelude
+ import CabalFmt.Fields
++import CabalFmt.Prelude
+
+ otherExtensionsF :: FieldDescrs () ()
+ otherExtensionsF = singletonF "other-extensions" pretty parse
+diff --git a/src/CabalFmt/Fields/Modules.hs b/src/CabalFmt/Fields/Modules.hs
+index 7309f4a..1f6b141 100644
+--- a/src/CabalFmt/Fields/Modules.hs
++++ b/src/CabalFmt/Fields/Modules.hs
+@@ -7,14 +7,14 @@ module CabalFmt.Fields.Modules (
+ exposedModulesF,
+ ) where
+
+-import qualified Distribution.ModuleName as C
+-import qualified Distribution.Parsec as C
+-import qualified Distribution.Parsec.Newtypes as C
+-import qualified Distribution.Pretty as C
+-import qualified Text.PrettyPrint as PP
++import qualified Distribution.FieldGrammar as C
++import qualified Distribution.ModuleName as C
++import qualified Distribution.Parsec as C
++import qualified Distribution.Pretty as C
++import qualified Text.PrettyPrint as PP
+
+-import CabalFmt.Prelude
+ import CabalFmt.Fields
++import CabalFmt.Prelude
+
+ exposedModulesF :: FieldDescrs () ()
+ exposedModulesF = singletonF "exposed-modules" pretty parse
+diff --git a/src/CabalFmt/Fields/SourceFiles.hs b/src/CabalFmt/Fields/SourceFiles.hs
+index fd8cf1a..a387640 100644
+--- a/src/CabalFmt/Fields/SourceFiles.hs
++++ b/src/CabalFmt/Fields/SourceFiles.hs
+@@ -9,11 +9,11 @@ module CabalFmt.Fields.SourceFiles (
+
+ import System.FilePath.Posix (splitDirectories)
+
+-import qualified Distribution.Fields as C
+-import qualified Distribution.Parsec as C
+-import qualified Distribution.Parsec.Newtypes as C
+-import qualified Distribution.Pretty as C
+-import qualified Text.PrettyPrint as PP
++import qualified Distribution.FieldGrammar as C
++import qualified Distribution.Fields as C
++import qualified Distribution.Parsec as C
++import qualified Distribution.Pretty as C
++import qualified Text.PrettyPrint as PP
+
+ import CabalFmt.Fields
+ import CabalFmt.Prelude
+diff --git a/src/CabalFmt/Fields/TestedWith.hs b/src/CabalFmt/Fields/TestedWith.hs
+index 333f8ca..4217300 100644
+--- a/src/CabalFmt/Fields/TestedWith.hs
++++ b/src/CabalFmt/Fields/TestedWith.hs
+@@ -12,7 +12,7 @@ import qualified Data.Set as Set
+ import qualified Distribution.CabalSpecVersion as C
+ import qualified Distribution.Compiler as C
+ import qualified Distribution.Parsec as C
+-import qualified Distribution.Parsec.Newtypes as C
++import qualified Distribution.FieldGrammar as C
+ import qualified Distribution.Pretty as C
+ import qualified Distribution.Version as C
+ import qualified Text.PrettyPrint as PP
+
More information about the arch-commits
mailing list