New submission from Ben Franksen <[email protected]>:

These are intended for branch-2.18, too, for a new release 2.18.4.

3 patches for repository /home/ben/src/darcs/screened:

patch 0aa5c612705657a5c0793d6d4750917edf723e8d
Author: Ben Franksen <[email protected]>
Date:   Sat Oct 12 23:13:05 CEST 2024
  * remove dependency on strict-identity

  This is done by bundling (only) the single module as
  src/Darcs/Util/StrictIdentity.hs.

patch 88ee1800fa50daf0825ce45a3a54eb014190f2bc
Author: Ben Franksen <[email protected]>
Date:   Sat Oct 12 23:22:49 CEST 2024
  * exclude certain versions of directory dependency only on windows

  The bug in the directory package that forces us to exclude these versions
  appears only on windows. This makes it possible to build darcs with stack
  against current stackage nightly, hopefully allowing darcs to get back into
  stackage and afterwards back into debian.

patch 38c471c1b592c6f5daece03b4c9ff021decd95a4
Author: Ben Franksen <[email protected]>
Date:   Mon Oct 14 09:31:02 CEST 2024
  * stack.yml: target lts-22.34, remove extra-deps

  This is the version ("resolver") that the debian haskell team currently uses
  to build haskell packages. To make darcs build against it (with no
  extra-deps), we also have to limit usage of tls>=2.0 to ghc>=9.8 (instead of
  ghc>=9.6) because lts-22.34 comes with ghc-9.6.6 but it still on tls-1.8.0.

  From now on, whenever we make changes to our cabal file, we should be
  careful to check that
  - stack build still works (i.e. finds a valid build plan) and
  - we adapt our stack.yml to whatever the debian haskell team targets
  These two steps should ensure continued availability of darcs in debian.

----------
files: patch-preview.txt, remove-dependency-on-strict_identity.dpatch
messages: 24087
nosy: bfrk
status: needs-screening
title: remove dependency on strict-identity (and 2 more)

__________________________________
Darcs bug tracker <[email protected]>
<https://bugs.darcs.net/patch2424>
__________________________________
[remove dependency on strict-identity
Ben Franksen <[email protected]>**20241012211305
 Ignore-this: 832020d9445251ff5374a524fe50af9dd3d42f06ebcfe4207cdd586a206e580a5869690c2bddc23b
 
 This is done by bundling (only) the single module as
 src/Darcs/Util/StrictIdentity.hs.
] hunk ./darcs.cabal 379
+                      Darcs.Util.StrictIdentity
hunk ./darcs.cabal 459
-                      terminal-size     >= 0.3.4 && < 0.4,
-                      strict-identity   >= 0.1 && < 0.2
+                      terminal-size     >= 0.3.4 && < 0.4
hunk ./src/Darcs/Patch/ApplyMonad.hs 40
+import Darcs.Util.StrictIdentity (StrictIdentity(..) )
hunk ./src/Darcs/Patch/ApplyMonad.hs 46
-import Control.Monad.StrictIdentity (StrictIdentity(..) )
addfile ./src/Darcs/Util/StrictIdentity.hs
hunk ./src/Darcs/Util/StrictIdentity.hs 1
+-- copied (and minimally adapted) from strict-identity-0.1.0.0
+-- which apparently has been abandoned
+{- |
+Module      :  Control.Monad.StrictIdentity
+Copyright   :  (c) Carter Schonwald 2013
+License     :  BSD3, see license file
+ 
+Maintainer  :  [email protected]
+Stability   :  experimental
+Portability :  portable
+-}
+{-# LANGUAGE BangPatterns #-}
+ 
+module Darcs.Util.StrictIdentity (
+    StrictIdentity(..),
+    runStrictIdentity)
+    where
+ 
+import Darcs.Prelude
+import Control.Monad.Fix 
+
+
+{- | 'StrictIdentity' is a newtype wrapper for a given type 'a' that 
+satisfies the 'Functor', 'Applicative', and 'Monad' laws  when restricted to
+terminating strict computations. 
+
+The typical use case is to provide a light weight strict nested 
+let notation for code that otherwise must use nested case expressions
+as a proxy for a strict let.
+
+the general pattern is to write code of the form
+
+@
+foo f h g x y z = runStrictIdentity $! do
+    w <- return $! f x y
+    j <- return $! h w z
+    res <- return $! g w j
+    return res
+@
+
+An example usage of 'StrictIdentity' that compiles to assembly 
+comparable to C is the following:
+
+@
+(>>) = unsafeShiftR
+(<<) = unsafeShiftL
+outerShuffle64A :: Word -> Word 
+outerShuffle64A !x =
+    runStrictIdentity $! do
+        x <- return $! ((x .&. 0x00000000FFFF0000) << 16 )
+            .|. ((x>>16) .&. 0x00000000FFFF0000) .|. (x .&. 0xFFFF00000000FFFF)
+        x <-  return $! ((x .&. 0x0000FF000000FF00 ) <<  8 )
+            .|. (x >> 8) .&. 0x0000FF000000FF00 .|. (x  .&. 0xFF0000FFFF0000FF)
+        x<-  return $! (( x .&. 0x00F000F000F000F0 ) << 4 )
+            .|. (x >> 4) .&. 0x00F000F000F000F0 .|. (x .&. 0xF00FF00FF00FF00F )
+        x<-   return $!((x .&.  0x0C0C0C0C0C0C0C0C )<< 2 )
+            .|. (x >> 2) .&. 0x0C0C0C0C0C0C0C0C .|.( x .&. 0xC3C3C3C3C3C3C3C3)
+        x<-   return $! ( (x .&. 0x2222222222222222)  << 1 ) 
+            .|. (x>> 1) .&. 0x2222222222222222 .|. (x .&. 0x9999999999999999)
+        return x
+@
+
+
+-}
+ 
+newtype StrictIdentity a =  StrictIdentity {runStrictIdentity_ :: a }
+ 
+-- | 'runStrictIdentity' unwraps a value of type  @'StrictIdentity' ty@  into a value of type @ty@,  strictly.
+runStrictIdentity :: StrictIdentity a -> a 
+runStrictIdentity !ma = case runStrictIdentity_ $! ma of 
+                            !res -> res  
+{-# INLINE  runStrictIdentity #-} 
+
+
+instance Applicative StrictIdentity where
+    {-# INLINE pure #-}
+    pure !a = StrictIdentity $! a
+    {-# INLINE (<*>) #-}
+    (<*>) a b = do   f <- a ; v <- b ; return $! (f $! v)
+    -- ap a b = liftM2 id a b  =  do  f <- a ; v<- b ; return ((id) )
+
+instance Functor StrictIdentity where
+    {-# INLINE fmap  #-}
+    fmap !f !m = StrictIdentity $! (f $! (runStrictIdentity m))
+ 
+instance Monad StrictIdentity where
+    {-# INLINE return  #-}
+    return = pure
+    {-# INLINE  (>>=) #-}
+    (!m) >>= (!k)  = k $! runStrictIdentity  m    
+ --StrictIdentity m >>= k  =  k $! m
+instance MonadFix StrictIdentity where
+    {-# INLINE mfix  #-}
+    mfix !f = StrictIdentity $! (fix  (runStrictIdentity . f))    
hunk ./stack.yaml 7
-- strict-identity-0.1.0.0

[exclude certain versions of directory dependency only on windows
Ben Franksen <[email protected]>**20241012212249
 Ignore-this: 265d0bf2d75afc200fa1d8e1d6d74b7b4f80f0282c95f43d6207f8773c7eccdd8638ebe3f43a84ef
 
 The bug in the directory package that forces us to exclude these versions
 appears only on windows. This makes it possible to build darcs with stack
 against current stackage nightly, hopefully allowing darcs to get back into
 stackage and afterwards back into debian.
] hunk ./darcs.cabal 412
-      build-depends:  Win32 >= 2.4.0 && < 2.14
+      build-depends:  Win32             >= 2.4.0 && < 2.14,
+                      -- exclude 1.3.8 .. 1.3.8.4 due to bug on windows
+                      directory         >= 1.2.7 && < 1.3.8 || >= 1.3.8.5 && < 1.4
hunk ./darcs.cabal 416
-      build-depends:  unix >= 2.7.1.0 && < 2.9
+      build-depends:  unix              >= 2.7.1.0 && < 2.9,
+                      directory         >= 1.2.7 && < 1.4
hunk ./darcs.cabal 449
-                      directory         >= 1.2.7 && < 1.3.8 || >= 1.3.8.5 && < 1.4,

[stack.yml: target lts-22.34, remove extra-deps
Ben Franksen <[email protected]>**20241014073102
 Ignore-this: 797697e1275126dcda57053d2036fd00dda8235a90d7cbda0c6fbdc58ec8b62e2fda470d6ada1bdb
 
 This is the version ("resolver") that the debian haskell team currently uses
 to build haskell packages. To make darcs build against it (with no
 extra-deps), we also have to limit usage of tls>=2.0 to ghc>=9.8 (instead of
 ghc>=9.6) because lts-22.34 comes with ghc-9.6.6 but it still on tls-1.8.0.
 
 From now on, whenever we make changes to our cabal file, we should be
 careful to check that
 - stack build still works (i.e. finds a valid build plan) and
 - we adapt our stack.yml to whatever the debian haskell team targets
 These two steps should ensure continued availability of darcs in debian.
] hunk ./darcs.cabal 463
-    if impl(ghc >= 9.6)
+    if impl(ghc >= 9.8)
hunk ./stack.yaml 1
-resolver: lts-21.25
+resolver: lts-22.34
hunk ./stack.yaml 5
-
-extra-deps:
-- safe-0.3.21

Attachment: remove-dependency-on-strict_identity.dpatch
Description: application/darcs-patch

_______________________________________________
darcs-devel mailing list
[email protected]
https://lists.darcs.net/mailman/listinfo/darcs-devel

Reply via email to