parconc-examples 0.3.4 → 0.3.5
raw patch · 18 files changed
+223/−203 lines, 18 filesdep ~basedep ~deepseqdep ~distributed-process
Dependency ranges changed: base, deepseq, distributed-process, distributed-static, filepath, repa, template-haskell, time
Files
- dist/build/parinfer/parinfer-tmp/Parse.hs +34/−32
- distrib-chat/chat-noslave.hs +2/−1
- distrib-chat/chat.hs +2/−1
- distrib-ping/ping-fail.hs +1/−1
- distrib-ping/ping-multi.hs +1/−1
- distrib-ping/ping-tc-merge.hs +1/−1
- distrib-ping/ping-tc-notify.hs +1/−1
- distrib-ping/ping-tc.hs +1/−1
- distrib-ping/ping.hs +1/−1
- kmeans/KMeansCore.hs +6/−3
- kmeans/kmeans.hs +2/−1
- parconc-examples.cabal +156/−154
- parinfer/InferMonad.hs +6/−0
- parinfer/parinfer.hs +1/−1
- timetable.hs +2/−1
- timetable1.hs +2/−1
- timetable2.hs +2/−1
- timetable3.hs +2/−1
dist/build/parinfer/parinfer-tmp/Parse.hs view
@@ -5,8 +5,9 @@ import Term import qualified Data.Array as Happy_Data_Array import qualified GHC.Exts as Happy_GHC_Exts+import Control.Applicative(Applicative(..)) --- parser produced by Happy Version 1.19.0+-- parser produced by Happy Version 1.19.4 newtype HappyAbsSyn t8 t9 t10 t11 = HappyAbsSyn HappyAny #if __GLASGOW_HASKELL__ >= 607@@ -316,6 +317,7 @@ +-- Do not remove this comment. Required to fix CPP parsing when using GCC and a clang-compiled alex. #if __GLASGOW_HASKELL__ > 706 #define LT(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.<# m)) :: Bool) #define GTE(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.>=# m)) :: Bool)@@ -325,7 +327,7 @@ #define GTE(n,m) (n Happy_GHC_Exts.>=# m) #define EQ(n,m) (n Happy_GHC_Exts.==# m) #endif-{-# LINE 45 "templates/GenericTemplate.hs" #-}+{-# LINE 46 "templates/GenericTemplate.hs" #-} data Happy_IntList = HappyCons Happy_GHC_Exts.Int# Happy_IntList@@ -334,11 +336,11 @@ -{-# LINE 66 "templates/GenericTemplate.hs" #-}+{-# LINE 67 "templates/GenericTemplate.hs" #-} -{-# LINE 76 "templates/GenericTemplate.hs" #-}+{-# LINE 77 "templates/GenericTemplate.hs" #-} -{-# LINE 85 "templates/GenericTemplate.hs" #-}+{-# LINE 86 "templates/GenericTemplate.hs" #-} infixr 9 `HappyStk` data HappyStk a = HappyStk a (HappyStk a)@@ -355,9 +357,9 @@ -- parse (a %partial parser). We must ignore the saved token on the top of -- the stack in this case. happyAccept 0# tk st sts (_ `HappyStk` ans `HappyStk` _) =- happyReturn1 ans+ happyReturn1 ans happyAccept j tk st sts (HappyStk ans _) = - (happyTcHack j (happyTcHack st)) (happyReturn1 ans)+ (happyTcHack j (happyTcHack st)) (happyReturn1 ans) ----------------------------------------------------------------------------- -- Arrays only: do the next action@@ -365,35 +367,35 @@ happyDoAction i tk st- = {- nothing -}+ = {- nothing -} - case action of- 0# -> {- nothing -}- happyFail i tk st- -1# -> {- nothing -}- happyAccept i tk st- n | LT(n,(0# :: Happy_GHC_Exts.Int#)) -> {- nothing -}+ case action of+ 0# -> {- nothing -}+ happyFail i tk st+ -1# -> {- nothing -}+ happyAccept i tk st+ n | LT(n,(0# :: Happy_GHC_Exts.Int#)) -> {- nothing -} - (happyReduceArr Happy_Data_Array.! rule) i tk st- where rule = (Happy_GHC_Exts.I# ((Happy_GHC_Exts.negateInt# ((n Happy_GHC_Exts.+# (1# :: Happy_GHC_Exts.Int#))))))- n -> {- nothing -}+ (happyReduceArr Happy_Data_Array.! rule) i tk st+ where rule = (Happy_GHC_Exts.I# ((Happy_GHC_Exts.negateInt# ((n Happy_GHC_Exts.+# (1# :: Happy_GHC_Exts.Int#))))))+ n -> {- nothing -} - happyShift new_state i tk st+ happyShift new_state i tk st where new_state = (n Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#)) where off = indexShortOffAddr happyActOffsets st off_i = (off Happy_GHC_Exts.+# i)- check = if GTE(off_i,(0# :: Happy_GHC_Exts.Int#))+ check = if GTE(off_i,(0# :: Happy_GHC_Exts.Int#)) then EQ(indexShortOffAddr happyCheck off_i, i)- else False+ else False action | check = indexShortOffAddr happyTable off_i | otherwise = indexShortOffAddr happyDefActions st indexShortOffAddr (HappyA# arr) off =- Happy_GHC_Exts.narrow16Int# i+ Happy_GHC_Exts.narrow16Int# i where i = Happy_GHC_Exts.word2Int# (Happy_GHC_Exts.or# (Happy_GHC_Exts.uncheckedShiftL# high 8#) low) high = Happy_GHC_Exts.int2Word# (Happy_GHC_Exts.ord# (Happy_GHC_Exts.indexCharOffAddr# arr (off' Happy_GHC_Exts.+# 1#)))@@ -412,7 +414,7 @@ ----------------------------------------------------------------------------- -- HappyState data type (not arrays) -{-# LINE 169 "templates/GenericTemplate.hs" #-}+{-# LINE 170 "templates/GenericTemplate.hs" #-} ----------------------------------------------------------------------------- -- Shifting a token@@ -454,9 +456,9 @@ = happyFail 0# tk st sts stk happyReduce k nt fn j tk st sts stk = case happyDrop (k Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#)) sts of- sts1@((HappyCons (st1@(action)) (_))) ->- let r = fn stk in -- it doesn't hurt to always seq here...- happyDoSeq r (happyGoto nt j tk st1 sts1 r)+ sts1@((HappyCons (st1@(action)) (_))) ->+ let r = fn stk in -- it doesn't hurt to always seq here...+ happyDoSeq r (happyGoto nt j tk st1 sts1 r) happyMonadReduce k nt fn 0# tk st sts stk = happyFail 0# tk st sts stk@@ -508,7 +510,7 @@ -- parse error if we are in recovery and we fail again happyFail 0# tk old_st _ stk@(x `HappyStk` _) = let i = (case Happy_GHC_Exts.unsafeCoerce# x of { (Happy_GHC_Exts.I# (i)) -> i }) in--- trace "failing" $ +-- trace "failing" $ happyError_ i tk {- We don't need state discarding for our restricted implementation of@@ -517,16 +519,16 @@ -- discard a state happyFail 0# tk old_st (HappyCons ((action)) (sts)) - (saved_tok `HappyStk` _ `HappyStk` stk) =--- trace ("discarding state, depth " ++ show (length stk)) $- happyDoAction 0# tk action sts ((saved_tok`HappyStk`stk))+ (saved_tok `HappyStk` _ `HappyStk` stk) =+-- trace ("discarding state, depth " ++ show (length stk)) $+ happyDoAction 0# tk action sts ((saved_tok`HappyStk`stk)) -} -- Enter error recovery: generate an error token, -- save the old token and carry on. happyFail i tk (action) sts stk = -- trace "entering error recovery" $- happyDoAction 0# tk action sts ( (Happy_GHC_Exts.unsafeCoerce# (Happy_GHC_Exts.I# (i))) `HappyStk` stk)+ happyDoAction 0# tk action sts ( (Happy_GHC_Exts.unsafeCoerce# (Happy_GHC_Exts.I# (i))) `HappyStk` stk) -- Internal happy errors: @@ -544,9 +546,9 @@ ----------------------------------------------------------------------------- -- Seq-ing. If the --strict flag is given, then Happy emits --- happySeq = happyDoSeq+-- happySeq = happyDoSeq -- otherwise it emits--- happySeq = happyDontSeq+-- happySeq = happyDontSeq happyDoSeq, happyDontSeq :: a -> b -> b happyDoSeq a b = a `seq` b
distrib-chat/chat-noslave.hs view
@@ -1,6 +1,7 @@ {-# LANGUAGE TemplateHaskell, DeriveDataTypeable, DeriveGeneric #-} {-# LANGUAGE RecordWildCards #-}-import Control.Distributed.Process hiding (mask, finally)+import Control.Distributed.Process+ hiding (Message, mask, finally, handleMessage, proxy) import Control.Distributed.Process.Closure import Control.Distributed.Process.Backend.SimpleLocalnet import Control.Distributed.Process.Node as Node hiding (newLocalNode)
distrib-chat/chat.hs view
@@ -1,6 +1,7 @@ {-# LANGUAGE TemplateHaskell, DeriveDataTypeable, DeriveGeneric #-} {-# LANGUAGE RecordWildCards #-}-import Control.Distributed.Process hiding (mask, finally)+import Control.Distributed.Process+ hiding (Message, mask, finally, handleMessage, proxy) import Control.Distributed.Process.Closure import Control.Concurrent.Async import Control.Monad.IO.Class
distrib-ping/ping-fail.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE TemplateHaskell, DeriveDataTypeable, DeriveGeneric #-} {-# OPTIONS_GHC -Wall #-}-import Control.Distributed.Process+import Control.Distributed.Process hiding (Message) import Control.Distributed.Process.Closure import Text.Printf
distrib-ping/ping-multi.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE TemplateHaskell, DeriveDataTypeable, DeriveGeneric #-} {-# OPTIONS_GHC -Wall #-}-import Control.Distributed.Process+import Control.Distributed.Process hiding (Message) import Control.Distributed.Process.Closure import Control.Monad
distrib-ping/ping-tc-merge.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE TemplateHaskell, DeriveDataTypeable, DeriveGeneric #-} {-# OPTIONS_GHC -Wall #-}-import Control.Distributed.Process+import Control.Distributed.Process hiding (Message) import Control.Distributed.Process.Closure import Control.Monad
distrib-ping/ping-tc-notify.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE TemplateHaskell, DeriveDataTypeable, DeriveGeneric #-} {-# OPTIONS_GHC -Wall #-}-import Control.Distributed.Process+import Control.Distributed.Process hiding (Message) import Control.Distributed.Process.Closure import Control.Monad
distrib-ping/ping-tc.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE TemplateHaskell, DeriveDataTypeable, DeriveGeneric #-} {-# OPTIONS_GHC -Wall #-}-import Control.Distributed.Process+import Control.Distributed.Process hiding (Message) import Control.Distributed.Process.Closure import Control.Monad
distrib-ping/ping.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE TemplateHaskell, DeriveDataTypeable, DeriveGeneric #-} {-# OPTIONS_GHC -Wall #-}-import Control.Distributed.Process+import Control.Distributed.Process hiding (Message) import Control.Distributed.Process.Closure import DistribUtils
kmeans/KMeansCore.hs view
@@ -19,7 +19,10 @@ data Point = Point {-#UNPACK#-}!Double {-#UNPACK#-}!Double deriving (Show,Read,Eq) -instance NFData Point+-- deepseq changed in GHC 7.10 to use Generic instances, so for backwards+-- compatibility define it manually.+instance NFData Point where+ rnf (Point x y) = () -- all fields are strict -- <<point-ops zeroPoint :: Point@@ -51,8 +54,8 @@ } deriving (Show,Read,Eq) -instance NFData Cluster -- default is ok, all the fields are strict-+instance NFData Cluster where+ rnf (Cluster id cent) = () -- all fields are strict makeCluster :: Int -> [Point] -> Cluster makeCluster clid points =
kmeans/kmeans.hs view
@@ -254,7 +254,8 @@ data PointSum = PointSum {-# UNPACK #-} !Int {-# UNPACK #-} !Double {-# UNPACK #-} !Double -instance NFData PointSum+instance NFData PointSum where+ rnf (PointSum count xs ys) = () -- all fields are strict -- <<addToPointSum addToPointSum :: PointSum -> Point -> PointSum
parconc-examples.cabal view
@@ -1,5 +1,5 @@ name: parconc-examples-version: 0.3.4+version: 0.3.5 synopsis: Examples to accompany the book "Parallel and Concurrent Programming in Haskell" -- description: license: BSD3@@ -54,6 +54,8 @@ default: False -- -f-accelerate: Do not build the examples that require accelerate.+-- Accelerate doesn't build with GHC 7.10 yet: accelerate-io-0.15+-- requires base <4.8. flag accelerate default : True@@ -68,15 +70,15 @@ executable rpar main-is: rpar.hs- build-depends: base >= 4.5 && < 4.8- , time ==1.4.*+ build-depends: base >= 4.5 && < 4.9+ , time >= 1.4 && < 1.6 , parallel ==3.2.* default-language: Haskell2010 executable sudoku1 main-is: sudoku1.hs other-modules: Sudoku- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , parallel ==3.2.* , array >= 0.4 && <0.6 default-language: Haskell2010@@ -84,17 +86,17 @@ executable sudoku2 main-is: sudoku2.hs other-modules: Sudoku- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , parallel ==3.2.* , array >= 0.4 && <0.6- , deepseq ==1.3.*+ , deepseq >= 1.3 && < 1.5 ghc-options: -threaded default-language: Haskell2010 executable sudoku3 main-is: sudoku3.hs other-modules: Sudoku- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , parallel ==3.2.* , array >= 0.4 && <0.6 ghc-options: -threaded@@ -103,7 +105,7 @@ executable sudoku4 main-is: sudoku4.hs other-modules: Sudoku- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , parallel ==3.2.* , array >= 0.4 && <0.6 ghc-options: -threaded@@ -112,7 +114,7 @@ executable sudoku5 main-is: sudoku5.hs other-modules: Sudoku- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , parallel ==3.2.* , array >= 0.4 && <0.6 ghc-options: -threaded@@ -123,21 +125,21 @@ executable strat main-is: strat.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , parallel ==3.2.* ghc-options: -threaded default-language: Haskell2010 executable strat2 main-is: strat2.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , parallel ==3.2.* ghc-options: -threaded default-language: Haskell2010 executable strat3 main-is: strat3.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , parallel ==3.2.* ghc-options: -threaded default-language: Haskell2010@@ -145,28 +147,28 @@ executable rsa main-is: rsa.hs other-modules: ByteStringCompat- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , bytestring >= 0.9 && < 0.11- , deepseq ==1.3.*+ , deepseq >= 1.3 && < 1.5 default-language: Haskell2010 executable rsa1 main-is: rsa1.hs other-modules: ByteStringCompat- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , bytestring >= 0.9 && < 0.11 , parallel ==3.2.*- , deepseq ==1.3.*+ , deepseq >= 1.3 && < 1.5 ghc-options: -threaded default-language: Haskell2010 executable rsa2 main-is: rsa2.hs other-modules: ByteStringCompat- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , bytestring >= 0.9 && < 0.11 , parallel ==3.2.*- , deepseq ==1.3.*+ , deepseq >= 1.3 && < 1.5 ghc-options: -threaded default-language: Haskell2010 @@ -174,10 +176,10 @@ hs-source-dirs: kmeans main-is: kmeans.hs other-modules: KMeansCore- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , parallel ==3.2.*- , time ==1.4.*- , deepseq ==1.3.*+ , time >= 1.4 && < 1.6+ , deepseq >= 1.3 && < 1.5 , monad-par >= 0.3.4 && < 0.4 -- monad-par 0.3 has a bug: -- https://github.com/simonmar/monad-par/issues/23@@ -191,13 +193,13 @@ executable GenSamples hs-source-dirs: kmeans main-is: GenSamples.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , binary >=0.6.3 && < 0.8 , array >= 0.4 && <0.6 , vector >= 0.10 && < 0.11 , random >= 1.0 && < 1.1 , normaldistribution >= 1.1 && < 1.2- , deepseq ==1.3.*+ , deepseq >= 1.3 && < 1.5 , bytestring >= 0.9 && < 0.11 default-language: Haskell2010 @@ -206,7 +208,7 @@ executable parmonad main-is: parmonad.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , monad-par >= 0.3.4 && < 0.4 ghc-options: -threaded default-language: Haskell2010@@ -214,10 +216,10 @@ executable rsa-pipeline main-is: rsa-pipeline.hs other-modules: ByteStringCompat Stream- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , bytestring >= 0.9 && < 0.11 , monad-par >= 0.3.4 && < 0.4- , deepseq ==1.3.*+ , deepseq >= 1.3 && < 1.5 ghc-options: -threaded default-language: Haskell2010 @@ -225,7 +227,7 @@ main-is: fwsparse.hs other-modules: SparseGraph MapCompat hs-source-dirs: fwsparse- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , random >= 1.0 && < 1.1 , array >= 0.4 && <0.6 , containers >= 0.4 && < 0.6@@ -235,46 +237,46 @@ main-is: fwsparse1.hs other-modules: SparseGraph MapCompat hs-source-dirs: fwsparse- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , random >= 1.0 && < 1.1 , array >= 0.4 && <0.6 , containers >= 0.4 && < 0.6 , monad-par >= 0.3.4 && < 0.4- , deepseq ==1.3.*+ , deepseq >= 1.3 && < 1.5 ghc-options: -threaded default-language: Haskell2010 executable timetable main-is: timetable.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , containers >= 0.4 && < 0.6- , deepseq ==1.3.*+ , deepseq >= 1.3 && < 1.5 , random >= 1.0 && < 1.1 default-language: Haskell2010 executable timetable1 main-is: timetable1.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , containers >= 0.4 && < 0.6- , deepseq ==1.3.*+ , deepseq >= 1.3 && < 1.5 , monad-par >= 0.3.4 && < 0.4 , random >= 1.0 && < 1.1 default-language: Haskell2010 executable timetable2 main-is: timetable2.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , containers >= 0.4 && < 0.6- , deepseq ==1.3.*+ , deepseq >= 1.3 && < 1.5 , monad-par >= 0.3.4 && < 0.4 , random >= 1.0 && < 1.1 default-language: Haskell2010 executable timetable3 main-is: timetable3.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , containers >= 0.4 && < 0.6- , deepseq ==1.3.*+ , deepseq >= 1.3 && < 1.5 , monad-par >= 0.3.4 && < 0.4 , random >= 1.0 && < 1.1 default-language: Haskell2010@@ -295,9 +297,9 @@ Infer Substitution StateX- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , containers >= 0.4 && < 0.6- , deepseq ==1.3.*+ , deepseq >= 1.3 && < 1.5 , monad-par >= 0.3.4 && < 0.4 , array >= 0.4 && <0.6 default-language: Haskell2010@@ -307,8 +309,8 @@ executable fwdense main-is: fwdense.hs- build-depends: base >= 4.5 && < 4.8- , repa == 3.2.*+ build-depends: base >= 4.5 && < 4.9+ , repa >= 3.2 && < 3.5 ghc-options: -O2 if flag(llvm) ghc-options: -fllvm@@ -316,8 +318,8 @@ executable fwdense1 main-is: fwdense1.hs- build-depends: base >= 4.5 && < 4.8- , repa == 3.2.*+ build-depends: base >= 4.5 && < 4.9+ , repa >= 3.2 && < 3.5 , transformers >=0.3 && <0.5 ghc-options: -O2 -threaded if flag(llvm)@@ -326,8 +328,8 @@ executable rotateimage main-is: rotateimage.hs- build-depends: base >= 4.5 && < 4.8- , repa == 3.2.*+ build-depends: base >= 4.5 && < 4.9+ , repa >= 3.2 && < 3.5 ghc-options: -O2 -threaded if flag(devil) build-depends: repa-devil == 0.3.*@@ -343,7 +345,7 @@ executable fwaccel main-is: fwaccel.hs other-modules: AccelerateCompat- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 ghc-options: -O2 if flag(accelerate) build-depends: accelerate >= 0.12 && < 0.15@@ -353,7 +355,7 @@ executable fwaccel-gpu main-is: fwaccel-gpu.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 if flag(accelerate) build-depends: accelerate >= 0.12 && < 0.15 else@@ -369,7 +371,7 @@ main-is: mandel.hs other-modules: Config hs-source-dirs: mandel- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , fclabels if flag(accelerate) build-depends: accelerate >= 0.12 && < 0.15@@ -388,17 +390,17 @@ executable fork main-is: fork.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 default-language: Haskell2010 executable reminders main-is: reminders.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 default-language: Haskell2010 executable reminders2 main-is: reminders2.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 default-language: Haskell2010 -- -----------------------------------------------------------------------------@@ -406,38 +408,38 @@ executable mvar1 main-is: mvar1.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 default-language: Haskell2010 executable mvar2 main-is: mvar2.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 default-language: Haskell2010 executable mvar3 main-is: mvar3.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 default-language: Haskell2010 executable logger main-is: logger.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 default-language: Haskell2010 executable phonebook main-is: phonebook.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , containers >= 0.4 && < 0.6 default-language: Haskell2010 executable chan main-is: chan.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 default-language: Haskell2010 executable chan2 main-is: chan2.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 default-language: Haskell2010 -- -----------------------------------------------------------------------------@@ -446,7 +448,7 @@ executable geturls1 main-is: geturls1.hs other-modules: GetURL- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , containers >= 0.4 && < 0.6 , network >= 2.3 && < 2.5 , HTTP ==4000.2.*@@ -456,10 +458,10 @@ executable geturls2 main-is: geturls2.hs other-modules: GetURL- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , stm ==2.4.* , bytestring >= 0.9 && < 0.11- , time ==1.4.*+ , time >= 1.4 && < 1.6 , network >= 2.3 && < 2.5 , HTTP ==4000.2.* default-language: Haskell2010@@ -467,10 +469,10 @@ executable geturls3 main-is: geturls3.hs other-modules: TimeIt GetURL- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , stm ==2.4.* , bytestring >= 0.9 && < 0.11- , time ==1.4.*+ , time >= 1.4 && < 1.6 , network >= 2.3 && < 2.5 , HTTP ==4000.2.* default-language: Haskell2010@@ -478,10 +480,10 @@ executable geturls4 main-is: geturls4.hs other-modules: GetURL- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , stm ==2.4.* , bytestring >= 0.9 && < 0.11- , time ==1.4.*+ , time >= 1.4 && < 1.6 , network >= 2.3 && < 2.5 , HTTP ==4000.2.* default-language: Haskell2010@@ -489,10 +491,10 @@ executable geturls5 main-is: geturls5.hs other-modules: GetURL- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , stm ==2.4.* , bytestring >= 0.9 && < 0.11- , time ==1.4.*+ , time >= 1.4 && < 1.6 , network >= 2.3 && < 2.5 , HTTP ==4000.2.* default-language: Haskell2010@@ -500,10 +502,10 @@ executable geturls6 main-is: geturls6.hs other-modules: TimeIt GetURL- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , stm ==2.4.* , bytestring >= 0.9 && < 0.11- , time ==1.4.*+ , time >= 1.4 && < 1.6 , network >= 2.3 && < 2.5 , HTTP ==4000.2.* default-language: Haskell2010@@ -514,10 +516,10 @@ executable geturlscancel main-is: geturlscancel.hs other-modules: TimeIt GetURL- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , stm ==2.4.* , bytestring >= 0.9 && < 0.11- , time ==1.4.*+ , time >= 1.4 && < 1.6 , network >= 2.3 && < 2.5 , HTTP ==4000.2.* default-language: Haskell2010@@ -525,37 +527,37 @@ executable geturlscancel2 main-is: geturlscancel2.hs other-modules: TimeIt GetURL- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , stm ==2.4.* , bytestring >= 0.9 && < 0.11- , time ==1.4.*+ , time >= 1.4 && < 1.6 , network >= 2.3 && < 2.5 , HTTP ==4000.2.* default-language: Haskell2010 executable modifytwo main-is: modifytwo.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 default-language: Haskell2010 executable chan3 main-is: chan3.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 default-language: Haskell2010 executable timeout main-is: timeout.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 default-language: Haskell2010 executable catch-mask main-is: catch-mask.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 default-language: Haskell2010 executable catch-mask2 main-is: catch-mask2.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 default-language: Haskell2010 -- -----------------------------------------------------------------------------@@ -564,49 +566,49 @@ -- not mentioned in the text? executable windowman main-is: windowman.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , containers >= 0.4 && < 0.6 , stm ==2.4.* default-language: Haskell2010 executable tmvar main-is: tmvar.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , stm ==2.4.* default-language: Haskell2010 executable geturlsfirst main-is: geturlsfirst.hs other-modules: ConcurrentUtils- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , stm ==2.4.* , bytestring >= 0.9 && < 0.11- , time ==1.4.*+ , time >= 1.4 && < 1.6 , HTTP ==4000.2.* , network >= 2.3 && < 2.5 default-language: Haskell2010 executable TChan main-is: TChan.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , stm ==2.4.* default-language: Haskell2010 executable TList main-is: TList.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , stm ==2.4.* default-language: Haskell2010 executable TQueue main-is: TQueue.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , stm ==2.4.* default-language: Haskell2010 executable TBQueue main-is: TBQueue.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , stm ==2.4.* default-language: Haskell2010 @@ -616,37 +618,37 @@ executable geturls7 main-is: geturls7.hs other-modules: ConcurrentUtils- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , stm ==2.4.* , bytestring >= 0.9 && < 0.11- , time ==1.4.*+ , time >= 1.4 && < 1.6 , network >= 2.3 && < 2.5 , HTTP ==4000.2.* default-language: Haskell2010 executable geturls8 main-is: geturls8.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , stm ==2.4.* , bytestring >= 0.9 && < 0.11- , time ==1.4.*+ , time >= 1.4 && < 1.6 , network >= 2.3 && < 2.5 , HTTP ==4000.2.* default-language: Haskell2010 executable geturls9 main-is: geturls9.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , stm ==2.4.* , bytestring >= 0.9 && < 0.11- , time ==1.4.*+ , time >= 1.4 && < 1.6 , network >= 2.3 && < 2.5 , HTTP ==4000.2.* default-language: Haskell2010 executable timeout2 main-is: timeout.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , async ==2.0.* default-language: Haskell2010 @@ -655,16 +657,16 @@ executable findseq main-is: findseq.hs- build-depends: base >= 4.5 && < 4.8- , filepath ==1.3.*+ build-depends: base >= 4.5 && < 4.9+ , filepath >= 1.3 && < 1.5 , directory >= 1.1 && < 1.3 default-language: Haskell2010 executable findpar main-is: findpar.hs ghc-options: -threaded- build-depends: base >= 4.5 && < 4.8- , filepath ==1.3.*+ build-depends: base >= 4.5 && < 4.9+ , filepath >= 1.3 && < 1.5 , directory >= 1.1 && < 1.3 , async ==2.0.* default-language: Haskell2010@@ -672,8 +674,8 @@ executable findpar2 main-is: findpar2.hs ghc-options: -threaded- build-depends: base >= 4.5 && < 4.8- , filepath ==1.3.*+ build-depends: base >= 4.5 && < 4.9+ , filepath >= 1.3 && < 1.5 , directory >= 1.1 && < 1.3 , async ==2.0.* default-language: Haskell2010@@ -682,8 +684,8 @@ main-is: findpar3.hs other-modules: CasIORef ghc-options: -threaded- build-depends: base >= 4.5 && < 4.8- , filepath ==1.3.*+ build-depends: base >= 4.5 && < 4.9+ , filepath >= 1.3 && < 1.5 , directory >= 1.1 && < 1.3 , async ==2.0.* , stm ==2.4.*@@ -692,8 +694,8 @@ executable findpar4 main-is: findpar4.hs ghc-options: -threaded- build-depends: base >= 4.5 && < 4.8- , filepath ==1.3.*+ build-depends: base >= 4.5 && < 4.9+ , filepath >= 1.3 && < 1.5 , directory >= 1.1 && < 1.3 , async ==2.0.* , stm ==2.4.*@@ -708,7 +710,7 @@ executable server main-is: server.hs other-modules: ConcurrentUtils- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , stm ==2.4.* , network >= 2.3 && < 2.5 default-language: Haskell2010@@ -716,7 +718,7 @@ executable server2 main-is: server2.hs other-modules: ConcurrentUtils- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , stm ==2.4.* , async ==2.0.* , network >= 2.3 && < 2.5@@ -725,7 +727,7 @@ executable chat main-is: chat.hs other-modules: ConcurrentUtils- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , containers >= 0.4 && < 0.6 , async ==2.0.* , stm ==2.4.*@@ -738,18 +740,18 @@ executable ping main-is: distrib-ping/ping.hs other-modules: DistribUtils- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , network >= 2.3 && < 2.5 , binary >=0.6.3 && < 0.8- , template-haskell >= 2.7 && < 2.10+ , template-haskell >= 2.7 && < 2.11 if impl(ghc <= 7.6) -- prior to ghc-7.4 generics lived in ghc-prim build-depends: ghc-prim if flag(distributed) build-depends:- distributed-process >= 0.4.2 && < 0.5+ distributed-process == 0.5.* , distributed-process-simplelocalnet ==0.2.*- , distributed-static ==0.2.*+ , distributed-static >= 0.2 && < 0.4 else buildable: False default-language: Haskell2010@@ -757,18 +759,18 @@ executable ping-multi main-is: distrib-ping/ping-multi.hs other-modules: DistribUtils- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , network >= 2.3 && < 2.5 , binary >=0.6.3 && < 0.8- , template-haskell >= 2.7 && < 2.10+ , template-haskell >= 2.7 && < 2.11 if impl(ghc <= 7.6) -- prior to ghc-7.4 generics lived in ghc-prim build-depends: ghc-prim if flag(distributed) build-depends:- distributed-process >= 0.4.2 && < 0.5+ distributed-process == 0.5.* , distributed-process-simplelocalnet ==0.2.*- , distributed-static ==0.2.*+ , distributed-static >= 0.2 && < 0.4 else buildable: False default-language: Haskell2010@@ -776,18 +778,18 @@ executable ping-tc main-is: distrib-ping/ping-tc.hs other-modules: DistribUtils- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , network >= 2.3 && < 2.5 , binary >=0.6.3 && < 0.8- , template-haskell >= 2.7 && < 2.10+ , template-haskell >= 2.7 && < 2.11 if impl(ghc <= 7.6) -- prior to ghc-7.4 generics lived in ghc-prim build-depends: ghc-prim if flag(distributed) build-depends:- distributed-process >= 0.4.2 && < 0.5+ distributed-process == 0.5.* , distributed-process-simplelocalnet ==0.2.*- , distributed-static ==0.2.*+ , distributed-static >= 0.2 && < 0.4 else buildable: False default-language: Haskell2010@@ -795,18 +797,18 @@ executable ping-tc-merge main-is: distrib-ping/ping-tc-merge.hs other-modules: DistribUtils- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , network >= 2.3 && < 2.5 , binary >=0.6.3 && < 0.8- , template-haskell >= 2.7 && < 2.10+ , template-haskell >= 2.7 && < 2.11 if impl(ghc <= 7.6) -- prior to ghc-7.4 generics lived in ghc-prim build-depends: ghc-prim if flag(distributed) build-depends:- distributed-process >= 0.4.2 && < 0.5+ distributed-process == 0.5.* , distributed-process-simplelocalnet ==0.2.*- , distributed-static ==0.2.*+ , distributed-static >= 0.2 && < 0.4 else buildable: False default-language: Haskell2010@@ -815,36 +817,36 @@ executable ping-tc-notify main-is: distrib-ping/ping-tc-notify.hs other-modules: DistribUtils- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , network >= 2.3 && < 2.5 , binary >=0.6.3 && < 0.8- , template-haskell >= 2.7 && < 2.10+ , template-haskell >= 2.7 && < 2.11 if impl(ghc <= 7.6) -- prior to ghc-7.4 generics lived in ghc-prim build-depends: ghc-prim if flag(distributed) build-depends:- distributed-process >= 0.4.2 && < 0.5+ distributed-process == 0.5.* , distributed-process-simplelocalnet ==0.2.*- , distributed-static ==0.2.*+ , distributed-static >= 0.2 && < 0.4 else buildable: False default-language: Haskell2010 executable ping-fail main-is: distrib-ping/ping-fail.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , network >= 2.3 && < 2.5 , binary >=0.6.3 && < 0.8- , template-haskell >= 2.7 && < 2.10+ , template-haskell >= 2.7 && < 2.11 if impl(ghc <= 7.6) -- prior to ghc-7.4 generics lived in ghc-prim build-depends: ghc-prim if flag(distributed) build-depends:- distributed-process >= 0.4.2 && < 0.5+ distributed-process == 0.5.* , distributed-process-simplelocalnet ==0.2.*- , distributed-static ==0.2.*+ , distributed-static >= 0.2 && < 0.4 else buildable: False default-language: Haskell2010@@ -852,22 +854,22 @@ executable distrib-chat main-is: distrib-chat/chat.hs other-modules: ConcurrentUtils DistribUtils- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , containers >= 0.4 && < 0.6 , stm ==2.4.* , async ==2.0.* , network >= 2.3 && < 2.5 , binary >=0.6.3 && < 0.8 , transformers >=0.3 && <0.5- , template-haskell >= 2.7 && < 2.10+ , template-haskell >= 2.7 && < 2.11 if impl(ghc <= 7.6) -- prior to ghc-7.4 generics lived in ghc-prim build-depends: ghc-prim if flag(distributed) build-depends:- distributed-process >= 0.4.2 && < 0.5+ distributed-process == 0.5.* , distributed-process-simplelocalnet ==0.2.*- , distributed-static ==0.2.*+ , distributed-static >= 0.2 && < 0.4 else buildable: False default-language: Haskell2010@@ -875,22 +877,22 @@ executable distrib-chat-noslave main-is: distrib-chat/chat-noslave.hs other-modules: ConcurrentUtils- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , containers >= 0.4 && < 0.6 , stm ==2.4.* , async ==2.0.* , network >= 2.3 && < 2.5 , binary >=0.6.3 && < 0.8 , transformers >=0.3 && <0.5- , template-haskell >= 2.7 && < 2.10+ , template-haskell >= 2.7 && < 2.11 if impl(ghc <= 7.6) -- prior to ghc-7.4 generics lived in ghc-prim build-depends: ghc-prim if flag(distributed) build-depends:- distributed-process >= 0.4.2 && < 0.5+ distributed-process == 0.5.* , distributed-process-simplelocalnet ==0.2.*- , distributed-static ==0.2.*+ , distributed-static >= 0.2 && < 0.4 else buildable: False default-language: Haskell2010@@ -899,22 +901,22 @@ main-is: db.hs hs-source-dirs: . distrib-db other-modules: DistribUtils Database- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , containers >= 0.4 && < 0.6 , stm ==2.4.* , async ==2.0.* , network >= 2.3 && < 2.5 , binary >=0.6.3 && < 0.8- , template-haskell >= 2.7 && < 2.10+ , template-haskell >= 2.7 && < 2.11 , transformers >=0.3 && <0.5 if impl(ghc <= 7.6) -- prior to ghc-7.4 generics lived in ghc-prim build-depends: ghc-prim if flag(distributed) build-depends:- distributed-process >= 0.4.2 && < 0.5+ distributed-process == 0.5.* , distributed-process-simplelocalnet ==0.2.*- , distributed-static ==0.2.*+ , distributed-static >= 0.2 && < 0.4 else buildable: False default-language: Haskell2010@@ -924,27 +926,27 @@ executable mvar4 main-is: mvar4.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 default-language: Haskell2010 executable deadlock1 main-is: deadlock1.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 default-language: Haskell2010 executable deadlock2 main-is: deadlock2.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 default-language: Haskell2010 executable threadperf1 main-is: threadperf1.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 default-language: Haskell2010 executable threadperf2 main-is: threadperf2.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 ghc-options: -rtsopts default-language: Haskell2010 @@ -955,9 +957,9 @@ main-is: bingtranslator.hs other-modules: BingTranslate GetURL hs-source-dirs: other .- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , bytestring >= 0.9 && < 0.11- , time ==1.4.*+ , time >= 1.4 && < 1.6 , HTTP ==4000.2.* , network >= 2.3 && < 2.5 , utf8-string ==0.3.*@@ -968,9 +970,9 @@ main-is: bingtranslatorconc.hs other-modules: BingTranslate GetURL hs-source-dirs: other .- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , bytestring >= 0.9 && < 0.11- , time ==1.4.*+ , time >= 1.4 && < 1.6 , HTTP ==4000.2.* , network >= 2.3 && < 2.5 , utf8-string ==0.3.*@@ -980,17 +982,17 @@ executable geturlsstm main-is: geturlsstm.hs other-modules: TimeIt GetURL- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , stm ==2.4.* , bytestring >= 0.9 && < 0.11- , time ==1.4.*+ , time >= 1.4 && < 1.6 , network >= 2.3 && < 2.5 , HTTP ==4000.2.* default-language: Haskell2010 executable Async main-is: Async.hs- build-depends: base >= 4.5 && < 4.8+ build-depends: base >= 4.5 && < 4.9 , stm ==2.4.* default-language: Haskell2010
parinfer/InferMonad.hs view
@@ -8,6 +8,9 @@ substituteI, unifyI, freshI, freshesI) where +import Control.Applicative+import Control.Monad+ import MaybeM import StateX (StateX, returnSX, eachSX, thenSX, toSX, putSX, getSX, useSX) import Type@@ -59,6 +62,9 @@ freshesI (n-1) `thenI` (\xs -> returnI (x:xs))) +instance Applicative Infer where+ pure = return+ (<*>) = ap instance Monad Infer where return = returnI
parinfer/parinfer.hs view
@@ -15,7 +15,7 @@ import Infer import Control.Monad.Par.Scheds.Trace import System.IO-import System.Exit+import System.Exit (exitWith, ExitCode(..)) import qualified Data.Map as Map main :: IO ()
timetable.hs view
@@ -15,7 +15,8 @@ newtype Talk = Talk Int deriving (Eq,Ord) -instance NFData Talk+instance NFData Talk where+ rnf (Talk x) = x `seq` () instance Show Talk where show (Talk t) = show t
timetable1.hs view
@@ -15,7 +15,8 @@ newtype Talk = Talk Int deriving (Eq,Ord) -instance NFData Talk+instance NFData Talk where+ rnf (Talk x) = x `seq` () instance Show Talk where show (Talk t) = show t
timetable2.hs view
@@ -16,7 +16,8 @@ newtype Talk = Talk Int deriving (Eq,Ord) -instance NFData Talk+instance NFData Talk where+ rnf (Talk x) = x `seq` () instance Show Talk where show (Talk t) = show t
timetable3.hs view
@@ -16,7 +16,8 @@ newtype Talk = Talk Int deriving (Eq,Ord) -instance NFData Talk+instance NFData Talk where+ rnf (Talk x) = x `seq` () instance Show Talk where show (Talk t) = show t