Permalink
Browse files

various fixes for GHC 7.4.1 etc.

  • Loading branch information...
1 parent 9c1947f commit 5ad45eff291ebbd76f3f4cf52a97a45204a5f70c @simonmar committed Feb 26, 2013
Showing with 69 additions and 43 deletions.
  1. +1 −1 chan2.hs
  2. +19 −0 fwsparse/MapCompat.hs
  3. +5 −0 fwsparse/SparseGraph.hs
  4. +2 −2 fwsparse/fwsparse.hs
  5. +3 −2 fwsparse/fwsparse1.hs
  6. +1 −0 geturlsfirst.hs
  7. +38 −38 parconc-examples.cabal
View
2 chan2.hs
@@ -60,7 +60,7 @@ main = do
c <- newChan
writeChan c 'a'
readChan c >>= print
- c2 <- duCphan c
+ c2 <- dupChan c
writeChan c 'b'
readChan c >>= print
readChan c2 >>= print
View
19 fwsparse/MapCompat.hs
@@ -0,0 +1,19 @@
+{-# LANGUAGE CPP #-}
+
+module MapCompat (module MapCompat, module Map) where
+
+#if !MIN_VERSION_containers(0,5,0)
+
+import Data.IntMap as Map
+import Control.Applicative
+import Data.Traversable
+
+traverseWithKey :: Applicative f => (Int -> a -> f b) -> IntMap a -> f (IntMap b)
+traverseWithKey f m =
+ Map.fromList `fmap` traverse (\(k,v) -> (,) <$> pure k <*> f k v) (Map.toList m)
+
+#else
+
+import qualified Data.IntMap.Strict as Map
+
+#endif
View
5 fwsparse/SparseGraph.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
module SparseGraph (
Vertex, Weight,
Graph,
@@ -9,7 +10,11 @@ module SparseGraph (
checksum
) where
+#if MIN_VERSION_containers(0,5,0)
import qualified Data.IntMap.Strict as Map
+#else
+import qualified Data.IntMap as Map
+#endif
import qualified Data.IntSet as IntSet
import Data.IntMap (IntMap)
import System.Random
View
4 fwsparse/fwsparse.hs
@@ -3,8 +3,8 @@
module Main ( main, runtest ) where
import System.Environment
-import qualified Data.IntMap.Strict as Map
-import Data.IntMap (IntMap)
+import qualified MapCompat as Map
+import MapCompat (IntMap)
import System.Random
import Data.List
import SparseGraph
View
5 fwsparse/fwsparse1.hs
@@ -5,8 +5,8 @@ module Main ( main, runtest ) where
import Control.Monad.Par.Scheds.Trace
-- gives slightly better results than Control.Monad.Par with monad-par-0.3.4
import System.Environment
-import qualified Data.IntMap as Map
-import Data.IntMap (IntMap)
+import qualified MapCompat as Map
+import MapCompat (IntMap)
import System.Random
import Data.List
import Data.Traversable hiding (mapM)
@@ -67,3 +67,4 @@ main = do
let g = mkStdGen 9999
let (mat,vs) = randomGraph g h 100 n
print (checksum (shortestPaths vs mat))
+
View
1 geturlsfirst.hs
@@ -12,6 +12,7 @@ import Control.Concurrent
import Control.Exception
import Control.Concurrent.STM
import Text.Printf
+import qualified Data.ByteString as B
-- -----------------------------------------------------------------------------
-- STM Async API
View
76 parconc-examples.cabal
@@ -83,7 +83,7 @@ executable kmeans
, monad-par >= 0.3.4 && < 0.4
-- monad-par 0.3 has a bug:
-- https://github.com/simonmar/monad-par/issues/23
- , binary >= 0.6.3 && < 0.7
+ , binary >= 0.5 && < 0.7
, array ==0.4.*
, bytestring >= 0.9 && < 0.11
, vector >= 0.10 && < 0.11
@@ -94,7 +94,7 @@ executable GenSamples
hs-source-dirs: kmeans
main-is: GenSamples.hs
build-depends: base >= 4.5 && < 4.7
- , binary >= 0.6.3 && < 0.7
+ , binary >= 0.5 && < 0.7
, array ==0.4.*
, vector >= 0.10 && < 0.11
, random >= 1.0 && < 1.1
@@ -243,7 +243,7 @@ executable geturls1
main-is: geturls1.hs
build-depends: base >= 4.5 && < 4.7
, containers >= 0.4 && < 0.6
- , network ==2.3.*
+ , network >= 2.3 && < 2.5
, HTTP ==4000.2.*
, bytestring >= 0.9 && < 0.11
default-language: Haskell2010
@@ -254,7 +254,7 @@ executable geturls2
, stm ==2.4.*
, bytestring >= 0.9 && < 0.11
, time ==1.4.*
- , network ==2.3.*
+ , network >= 2.3 && < 2.5
, HTTP ==4000.2.*
default-language: Haskell2010
@@ -264,7 +264,7 @@ executable geturls3
, stm ==2.4.*
, bytestring >= 0.9 && < 0.11
, time ==1.4.*
- , network ==2.3.*
+ , network >= 2.3 && < 2.5
, HTTP ==4000.2.*
default-language: Haskell2010
@@ -274,7 +274,7 @@ executable geturls4
, stm ==2.4.*
, bytestring >= 0.9 && < 0.11
, time ==1.4.*
- , network ==2.3.*
+ , network >= 2.3 && < 2.5
, HTTP ==4000.2.*
default-language: Haskell2010
@@ -284,7 +284,7 @@ executable geturls5
, stm ==2.4.*
, bytestring >= 0.9 && < 0.11
, time ==1.4.*
- , network ==2.3.*
+ , network >= 2.3 && < 2.5
, HTTP ==4000.2.*
default-language: Haskell2010
@@ -294,7 +294,7 @@ executable geturls6
, stm ==2.4.*
, bytestring >= 0.9 && < 0.11
, time ==1.4.*
- , network ==2.3.*
+ , network >= 2.3 && < 2.5
, HTTP ==4000.2.*
default-language: Haskell2010
@@ -307,7 +307,7 @@ executable geturlscancel
, stm ==2.4.*
, bytestring >= 0.9 && < 0.11
, time ==1.4.*
- , network ==2.3.*
+ , network >= 2.3 && < 2.5
, HTTP ==4000.2.*
default-language: Haskell2010
@@ -317,7 +317,7 @@ executable geturlscancel2
, stm ==2.4.*
, bytestring >= 0.9 && < 0.11
, time ==1.4.*
- , network ==2.3.*
+ , network >= 2.3 && < 2.5
, HTTP ==4000.2.*
default-language: Haskell2010
@@ -370,7 +370,7 @@ executable geturlsfirst
, bytestring >= 0.9 && < 0.11
, time ==1.4.*
, HTTP ==4000.2.*
- , network ==2.3.*
+ , network >= 2.3 && < 2.5
default-language: Haskell2010
executable TChan
@@ -406,7 +406,7 @@ executable geturls7
, stm ==2.4.*
, bytestring >= 0.9 && < 0.11
, time ==1.4.*
- , network ==2.3.*
+ , network >= 2.3 && < 2.5
, HTTP ==4000.2.*
default-language: Haskell2010
@@ -416,7 +416,7 @@ executable geturls8
, stm ==2.4.*
, bytestring >= 0.9 && < 0.11
, time ==1.4.*
- , network ==2.3.*
+ , network >= 2.3 && < 2.5
, HTTP ==4000.2.*
default-language: Haskell2010
@@ -426,7 +426,7 @@ executable geturls9
, stm ==2.4.*
, bytestring >= 0.9 && < 0.11
, time ==1.4.*
- , network ==2.3.*
+ , network >= 2.3 && < 2.5
, HTTP ==4000.2.*
default-language: Haskell2010
@@ -490,15 +490,15 @@ executable server
main-is: server.hs
build-depends: base >= 4.5 && < 4.7
, stm ==2.4.*
- , network ==2.3.*
+ , network >= 2.3 && < 2.5
default-language: Haskell2010
executable server2
main-is: server2.hs
build-depends: base >= 4.5 && < 4.7
, stm ==2.4.*
, async ==2.0.*
- , network ==2.3.*
+ , network >= 2.3 && < 2.5
default-language: Haskell2010
executable chat
@@ -507,7 +507,7 @@ executable chat
, containers >= 0.4 && < 0.6
, async ==2.0.*
, stm ==2.4.*
- , network ==2.3.*
+ , network >= 2.3 && < 2.5
default-language: Haskell2010
-- -----------------------------------------------------------------------------
@@ -516,8 +516,8 @@ executable chat
executable ping
main-is: distrib-ping/ping.hs
build-depends: base >= 4.5 && < 4.7
- , network ==2.3.*
- , binary >= 0.6.3 && < 0.7
+ , network >= 2.3 && < 2.5
+ , binary >= 0.5 && < 0.7
, distributed-process >= 0.4.2 && < 0.5
, distributed-process-simplelocalnet ==0.2.*
, distributed-static ==0.2.*
@@ -530,8 +530,8 @@ executable ping
executable ping-multi
main-is: distrib-ping/ping-multi.hs
build-depends: base >= 4.5 && < 4.7
- , network ==2.3.*
- , binary >= 0.6.3 && < 0.7
+ , network >= 2.3 && < 2.5
+ , binary >= 0.5 && < 0.7
, distributed-process >= 0.4.2 && < 0.5
, distributed-process-simplelocalnet ==0.2.*
, distributed-static ==0.2.*
@@ -544,8 +544,8 @@ executable ping-multi
executable ping-tc
main-is: distrib-ping/ping-tc.hs
build-depends: base >= 4.5 && < 4.7
- , network ==2.3.*
- , binary >= 0.6.3 && < 0.7
+ , network >= 2.3 && < 2.5
+ , binary >= 0.5 && < 0.7
, distributed-process >= 0.4.2 && < 0.5
, distributed-process-simplelocalnet ==0.2.*
, distributed-static ==0.2.*
@@ -558,8 +558,8 @@ executable ping-tc
executable ping-tc-merge
main-is: distrib-ping/ping-tc-merge.hs
build-depends: base >= 4.5 && < 4.7
- , network ==2.3.*
- , binary >= 0.6.3 && < 0.7
+ , network >= 2.3 && < 2.5
+ , binary >= 0.5 && < 0.7
, distributed-process >= 0.4.2 && < 0.5
, distributed-process-simplelocalnet ==0.2.*
, distributed-static ==0.2.*
@@ -573,8 +573,8 @@ executable ping-tc-merge
executable ping-tc-notify
main-is: distrib-ping/ping-tc-notify.hs
build-depends: base >= 4.5 && < 4.7
- , network ==2.3.*
- , binary >= 0.6.3 && < 0.7
+ , network >= 2.3 && < 2.5
+ , binary >= 0.5 && < 0.7
, distributed-process >= 0.4.2 && < 0.5
, distributed-process-simplelocalnet ==0.2.*
, distributed-static ==0.2.*
@@ -587,8 +587,8 @@ executable ping-tc-notify
executable ping-fail
main-is: distrib-ping/ping-fail.hs
build-depends: base >= 4.5 && < 4.7
- , network ==2.3.*
- , binary >= 0.6.3 && < 0.7
+ , network >= 2.3 && < 2.5
+ , binary >= 0.5 && < 0.7
, distributed-process >= 0.4.2 && < 0.5
, distributed-process-simplelocalnet ==0.2.*
, distributed-static ==0.2.*
@@ -604,8 +604,8 @@ executable distrib-chat
, containers >= 0.4 && < 0.6
, stm ==2.4.*
, async ==2.0.*
- , network ==2.3.*
- , binary >= 0.6.3 && < 0.7
+ , network >= 2.3 && < 2.5
+ , binary >= 0.5 && < 0.7
, distributed-process >= 0.4.2 && < 0.5
, distributed-process-simplelocalnet ==0.2.*
, distributed-static ==0.2.*
@@ -622,8 +622,8 @@ executable distrib-chat-noslave
, containers >= 0.4 && < 0.6
, stm ==2.4.*
, async ==2.0.*
- , network ==2.3.*
- , binary >= 0.6.3 && < 0.7
+ , network >= 2.3 && < 2.5
+ , binary >= 0.5 && < 0.7
, distributed-process >= 0.4.2 && < 0.5
, distributed-process-simplelocalnet ==0.2.*
, distributed-static ==0.2.*
@@ -641,8 +641,8 @@ executable distrib-db
, containers >= 0.4 && < 0.6
, stm ==2.4.*
, async ==2.0.*
- , network ==2.3.*
- , binary >= 0.6.3 && < 0.7
+ , network >= 2.3 && < 2.5
+ , binary >= 0.5 && < 0.7
, distributed-process >= 0.4.2 && < 0.5
, distributed-process-simplelocalnet ==0.2.*
, distributed-static ==0.2.*
@@ -691,7 +691,7 @@ executable bingtranslator
, bytestring >= 0.9 && < 0.11
, time ==1.4.*
, HTTP ==4000.2.*
- , network ==2.3.*
+ , network >= 2.3 && < 2.5
, utf8-string ==0.3.*
, xml ==1.3.*
default-language: Haskell2010
@@ -702,7 +702,7 @@ executable bingtranslatorconc
, bytestring >= 0.9 && < 0.11
, time ==1.4.*
, HTTP ==4000.2.*
- , network ==2.3.*
+ , network >= 2.3 && < 2.5
, utf8-string ==0.3.*
, xml ==1.3.*
default-language: Haskell2010
@@ -713,7 +713,7 @@ executable geturlsstm
, stm ==2.4.*
, bytestring >= 0.9 && < 0.11
, time ==1.4.*
- , network ==2.3.*
+ , network >= 2.3 && < 2.5
, HTTP ==4000.2.*
default-language: Haskell2010

0 comments on commit 5ad45ef

Please sign in to comment.