[arch-commits] Commit in haskell-polysemy/repos (3 files)

Felix Yan felixonmars at archlinux.org
Wed Jul 7 09:14:49 UTC 2021


    Date: Wednesday, July 7, 2021 @ 09:14:49
  Author: felixonmars
Revision: 974267

archrelease: copy trunk to community-staging-x86_64

Added:
  haskell-polysemy/repos/community-staging-x86_64/
  haskell-polysemy/repos/community-staging-x86_64/PKGBUILD
    (from rev 974266, haskell-polysemy/trunk/PKGBUILD)
  haskell-polysemy/repos/community-staging-x86_64/ghc9.patch
    (from rev 974266, haskell-polysemy/trunk/ghc9.patch)

------------+
 PKGBUILD   |   57 ++++++++++++++++++++++
 ghc9.patch |  147 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 204 insertions(+)

Copied: haskell-polysemy/repos/community-staging-x86_64/PKGBUILD (from rev 974266, haskell-polysemy/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD	                        (rev 0)
+++ community-staging-x86_64/PKGBUILD	2021-07-07 09:14:49 UTC (rev 974267)
@@ -0,0 +1,57 @@
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+
+_hkgname=polysemy
+pkgname=haskell-polysemy
+pkgver=1.5.0.0
+pkgrel=18
+pkgdesc="Higher-order, low-boilerplate, zero-cost free monads"
+url="https://github.com/isovector/polysemy"
+license=('BSD')
+arch=('x86_64')
+depends=('ghc-libs' 'haskell-quickcheck' 'haskell-async' 'haskell-first-class-families' 'haskell-syb'
+         'haskell-th-abstraction' 'haskell-type-errors' 'haskell-type-errors-pretty'
+         'haskell-unagi-chan')
+makedepends=('ghc' 'uusi' 'haskell-cabal-doctest' 'haskell-hspec-discover' 'haskell-doctest' 'haskell-hspec'
+             'haskell-inspection-testing')
+source=("https://hackage.haskell.org/packages/archive/$_hkgname/$pkgver/$_hkgname-$pkgver.tar.gz"
+        ghc9.patch)
+sha512sums=('4cc5c348b75e6bdf7b15c926786a4bd6fec2c6aa5e0862d865aefe8a49e7ce5eadd1203b641fa4c9e398a04bd66def40196725fbdee479ded8661b5bea3bb99e'
+            '6bef2b9dac5a600d36aafabd3dffa3c5d81c3aff80cf039c9c2e1a2c39d5bd3e9ca234bb8b3366aae12c386c21a3922d8d68993367d5a35a9b21e0e5f0a86bcb')
+
+prepare() {
+  cd $_hkgname-$pkgver
+  patch -p1 -i ../ghc9.patch
+  uusi -u doctest $_hkgname.cabal
+}
+
+build() {
+  cd $_hkgname-$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=-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 $_hkgname-$pkgver
+  # https://github.com/polysemy-research/polysemy/pull/410#issuecomment-868183832
+  runhaskell Setup test --show-details=direct || echo "Tests failed"
+}
+
+package() {
+  cd $_hkgname-$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 "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+  rm -f "$pkgdir"/usr/share/doc/$pkgname/LICENSE
+}

Copied: haskell-polysemy/repos/community-staging-x86_64/ghc9.patch (from rev 974266, haskell-polysemy/trunk/ghc9.patch)
===================================================================
--- community-staging-x86_64/ghc9.patch	                        (rev 0)
+++ community-staging-x86_64/ghc9.patch	2021-07-07 09:14:49 UTC (rev 974267)
@@ -0,0 +1,147 @@
+From 23c9912f6ac665e54096a436e9ef63b98ad5ecb4 Mon Sep 17 00:00:00 2001
+From: Torsten Schmits <torstenschmits at gmail.com>
+Date: Sat, 17 Apr 2021 01:35:20 +0200
+Subject: [PATCH 1/4] start migration to ghc9
+
+---
+ flake.lock                            | 43 +++++++++++++++++++--------
+ flake.nix                             | 37 +++++++++++++++--------
+ nix/overlay.nix                       | 32 ++++++++------------
+ polysemy-plugin/package.yaml          |  4 +--
+ polysemy-plugin/polysemy-plugin.cabal |  6 ++--
+ src/Polysemy/Internal.hs              |  2 +-
+ src/Polysemy/Internal/Combinators.hs  |  4 +--
+ src/Polysemy/Internal/TH/Common.hs    | 26 ++++++++++++++--
+ src/Polysemy/Internal/TH/Effect.hs    |  2 +-
+ src/Polysemy/Internal/Tactics.hs      |  2 +-
+ 10 files changed, 100 insertions(+), 58 deletions(-)
+
+diff --git a/src/Polysemy/Internal.hs b/src/Polysemy/Internal.hs
+index 9c06df4..dcc7c24 100644
+--- a/src/Polysemy/Internal.hs
++++ b/src/Polysemy/Internal.hs
+@@ -267,7 +267,7 @@ instance Functor (Sem f) where
+ 
+ 
+ instance Applicative (Sem f) where
+-  pure a = Sem $ const $ pure a
++  pure a = Sem $ \_ -> pure a
+   {-# INLINE pure #-}
+ 
+   Sem f <*> Sem a = Sem $ \k -> f k <*> a k
+diff --git a/src/Polysemy/Internal/Combinators.hs b/src/Polysemy/Internal/Combinators.hs
+index dd8b459..b67751c 100644
+--- a/src/Polysemy/Internal/Combinators.hs
++++ b/src/Polysemy/Internal/Combinators.hs
+@@ -59,7 +59,7 @@ firstOrder higher f = higher $ \(e :: e (Sem rInitial) x) ->
+ -- transforming it into other effects inside of @r at .
+ interpret
+     :: FirstOrder e "interpret"
+-    => (∀ x rInitial. e (Sem rInitial) x -> Sem r x)
++    => (∀ rInitial x. e (Sem rInitial) x -> Sem r x)
+        -- ^ A natural transformation from the handled effect to other effects
+        -- already in 'Sem'.
+     -> Sem (e ': r) a
+@@ -75,7 +75,7 @@ interpret = firstOrder interpretH
+ --
+ -- See the notes on 'Tactical' for how to use this function.
+ interpretH
+-    :: (∀ x rInitial . e (Sem rInitial) x -> Tactical e (Sem rInitial) r x)
++    :: (∀ rInitial x . e (Sem rInitial) x -> Tactical e (Sem rInitial) r x)
+        -- ^ A natural transformation from the handled effect to other effects
+        -- already in 'Sem'.
+     -> Sem (e ': r) a
+diff --git a/src/Polysemy/Internal/TH/Common.hs b/src/Polysemy/Internal/TH/Common.hs
+index 8296df6..2130157 100644
+--- a/src/Polysemy/Internal/TH/Common.hs
++++ b/src/Polysemy/Internal/TH/Common.hs
+@@ -215,7 +215,11 @@ missingEffArgs name = fail $ show
+       )
+   where
+     base = capturableBase name
++#if MIN_VERSION_template_haskell(2,17,0)
++    args = flip PlainTV () . mkName <$> ["m", "a"]
++#else
+     args = PlainTV . mkName <$> ["m", "a"]
++#endif
+ 
+ notDataCon :: Name -> Q a
+ notDataCon name = fail $ show
+@@ -226,12 +230,20 @@ notDataCon name = fail $ show
+ -- TH utilities --------------------------------------------------------------
+ ------------------------------------------------------------------------------
+ 
++arrows :: Type -> Bool
++arrows = \case
++  ArrowT -> True
++#if MIN_VERSION_template_haskell(2,17,0)
++  AppT MulArrowT _ -> True
++#endif
++  _ -> False
++
+ ------------------------------------------------------------------------------
+ -- | Pattern constructing function type and matching on one that may contain
+ -- type annotations on arrow itself.
+ infixr 1 :->
+ pattern (:->) :: Type -> Type -> Type
+-pattern a :-> b <- (removeTyAnns -> ArrowT) `AppT` a `AppT` b where
++pattern a :-> b <- (arrows . removeTyAnns -> True) `AppT` a `AppT` b where
+   a :-> b = ArrowT `AppT` a `AppT` b
+ 
+ 
+@@ -249,8 +261,13 @@ capturableTVars = everywhere $ mkT $ \case
+   VarT n          -> VarT $ capturableBase n
+   ForallT bs cs t -> ForallT (goBndr <$> bs) (capturableTVars <$> cs) t
+     where
++#if MIN_VERSION_template_haskell(2,17,0)
++      goBndr (PlainTV n flag) = PlainTV (capturableBase n) flag
++      goBndr (KindedTV n flag k) = KindedTV (capturableBase n) flag $ capturableTVars k
++#else
+       goBndr (PlainTV n   ) = PlainTV $ capturableBase n
+       goBndr (KindedTV n k) = KindedTV (capturableBase n) $ capturableTVars k
++#endif
+   t -> t
+ 
+ 
+@@ -274,8 +291,13 @@ simplifyKinds = everywhere $ mkT $ \case
+   SigT t VarT{}   -> t
+   ForallT bs cs t -> ForallT (goBndr <$> bs) (simplifyKinds <$> cs) t
+     where
+-      goBndr (KindedTV n StarT ) = PlainTV n
++#if MIN_VERSION_template_haskell(2,17,0)
++      goBndr (KindedTV n flag StarT) = PlainTV n flag
++      goBndr (KindedTV n flag VarT{}) = PlainTV n flag
++#else
++      goBndr (KindedTV n StarT) = PlainTV n
+       goBndr (KindedTV n VarT{}) = PlainTV n
++#endif
+       goBndr b = b
+   t -> t
+ 
+diff --git a/src/Polysemy/Internal/TH/Effect.hs b/src/Polysemy/Internal/TH/Effect.hs
+index 12de450..12fa2fc 100644
+--- a/src/Polysemy/Internal/TH/Effect.hs
++++ b/src/Polysemy/Internal/TH/Effect.hs
+@@ -108,7 +108,7 @@ makeSem_ :: Name -> Q [Dec]
+ makeSem_ = genFreer False
+ -- NOTE(makeSem_):
+ -- This function uses an ugly hack to work --- it changes names in data
+--- constructor's type to capturable ones. This allows user to provide them to
++-- constructor's type to capturable ones. This allows users to provide them to
+ -- us from their signature through 'forall' with 'ScopedTypeVariables'
+ -- enabled, so that we can compile liftings of constructors with ambiguous
+ -- type arguments (see issue #48).
+diff --git a/src/Polysemy/Internal/Tactics.hs b/src/Polysemy/Internal/Tactics.hs
+index d12a036..5c46cdd 100644
+--- a/src/Polysemy/Internal/Tactics.hs
++++ b/src/Polysemy/Internal/Tactics.hs
+@@ -127,7 +127,7 @@ newtype Inspector f = Inspector
+ 
+ ------------------------------------------------------------------------------
+ -- | Lift a value into 'Tactical'.
+-pureT :: a -> Tactical e m r a
++pureT :: Functor f => a -> Sem (WithTactics e f m r) (f a)
+ pureT a = do
+   istate <- getInitialStateT
+   pure $ a <$ istate
+




More information about the arch-commits mailing list