git.iko.soy/distributed-process
on master help sign in
Better .cabal file
4cef142Edsko de Vries
network-transport-2/network-transport.cabal+8−4
@@ -3,12 +3,16 @@ Version: 0.1.0
3Description: Network Transport
3Description: Network Transport
4Author: Duncan Coutts, Nicolas Wu, Edsko de Vries
4Author: Duncan Coutts, Nicolas Wu, Edsko de Vries
5Maintainer: dcoutts@well-typed.com
5Maintainer: dcoutts@well-typed.com
6+License: BSD3
7+License-file: LICENSE
8+Synopsis: Network abstraction layer
9+Category: Network
6Homepage: http://github.com/haskell-distributed
10Homepage: http://github.com/haskell-distributed
7Build-Type: Simple
11Build-Type: Simple
8Cabal-Version: >=1.9.2
12Cabal-Version: >=1.9.2
9
13
10Library
14Library
11− Build-Depends: base >= 4,
15+ Build-Depends: base >= 4 && < 5,
12 bytestring,
16 bytestring,
13 containers,
17 containers,
14 data-accessor,
18 data-accessor,
@@ -34,7 +38,7 @@ Test-Suite TestTCP
34 mtl,
38 mtl,
35 transformers,
39 transformers,
36 ansi-terminal
40 ansi-terminal
37− extensions: OverloadedStrings, ForeignFunctionInterface, FlexibleContexts, DeriveDataTypeable
41+ extensions: OverloadedStrings, ForeignFunctionInterface, DeriveDataTypeable, ExistentialQuantification, FlexibleInstances, RankNTypes, OverlappingInstances
38 ghc-options: -Wall -fno-warn-unused-do-bind
42 ghc-options: -Wall -fno-warn-unused-do-bind
39 HS-Source-Dirs: tests src
43 HS-Source-Dirs: tests src
40
44
@@ -48,7 +52,7 @@ Test-Suite TestMulticastInMemory
48 mtl,
52 mtl,
49 transformers,
53 transformers,
50 ansi-terminal
54 ansi-terminal
51− extensions: OverloadedStrings, ForeignFunctionInterface, FlexibleContexts, DeriveDataTypeable
55+ extensions: OverloadedStrings, ForeignFunctionInterface, DeriveDataTypeable, ExistentialQuantification, FlexibleInstances, RankNTypes, OverlappingInstances
52 ghc-options: -Wall -fno-warn-unused-do-bind
56 ghc-options: -Wall -fno-warn-unused-do-bind
53 HS-Source-Dirs: tests src
57 HS-Source-Dirs: tests src
54
58
@@ -62,6 +66,6 @@ Test-Suite TestInMemory
62 mtl,
66 mtl,
63 transformers,
67 transformers,
64 ansi-terminal
68 ansi-terminal
65− extensions: OverloadedStrings, ForeignFunctionInterface, FlexibleContexts, DeriveDataTypeable
69+ extensions: OverloadedStrings, ForeignFunctionInterface, DeriveDataTypeable, ExistentialQuantification, FlexibleInstances, RankNTypes, OverlappingInstances
66 ghc-options: -Wall -fno-warn-unused-do-bind
70 ghc-options: -Wall -fno-warn-unused-do-bind
67 HS-Source-Dirs: tests src
71 HS-Source-Dirs: tests src
network-transport-2/src/Network/Transport/Internal.hs+2−2
@@ -9,14 +9,14 @@ module Network.Transport.Internal ( -- * Encoders/decoders
9 , mapExceptionIO
9 , mapExceptionIO
10 , tryIO
10 , tryIO
11 , tryToEnum
11 , tryToEnum
12− , void
12+ , void
13 -- * Debugging
13 -- * Debugging
14 , tlog
14 , tlog
15 ) where
15 ) where
16
16
17import Prelude hiding (catch)
17import Prelude hiding (catch)
18import Foreign.Storable (pokeByteOff, peekByteOff)
18import Foreign.Storable (pokeByteOff, peekByteOff)
19−import Foreign.C (CInt, CShort)
19+import Foreign.C (CInt(..), CShort(..))
20import Foreign.ForeignPtr (withForeignPtr)
20import Foreign.ForeignPtr (withForeignPtr)
21import Data.ByteString (ByteString)
21import Data.ByteString (ByteString)
22import qualified Data.ByteString as BS (length)
22import qualified Data.ByteString as BS (length)
network-transport-2/src/Network/Transport/TCP.hs+1−1
@@ -39,7 +39,7 @@ import Network.Transport.Internal ( encodeInt32
39 , mapExceptionIO
39 , mapExceptionIO
40 , tryIO
40 , tryIO
41 , tryToEnum
41 , tryToEnum
42− , void
42+ , void
43 )
43 )
44import qualified Network.Socket as N ( HostName
44import qualified Network.Socket as N ( HostName
45 , ServiceName
45 , ServiceName
network-transport-2/tests/TestTransport.hs+1−1
@@ -1,4 +1,4 @@
1−{-# LANGUAGE RebindableSyntax, FlexibleInstances, OverlappingInstances, UndecidableInstances #-}
1+{-# LANGUAGE RebindableSyntax #-}
2module TestTransport where
2module TestTransport where
3
3
4import Prelude hiding (catch, (>>=), (>>), return, fail)
4import Prelude hiding (catch, (>>=), (>>), return, fail)
network-transport-2/tests/Traced.hs+5−7
@@ -1,4 +1,3 @@
1−{-# LANGUAGE RebindableSyntax, ScopedTypeVariables, DeriveDataTypeable, FlexibleInstances, OverlappingInstances, ExistentialQuantification, RankNTypes #-}
2-- | Add tracing to the IO monad (see examples).
1-- | Add tracing to the IO monad (see examples).
3--
2--
4-- [Usage]
3-- [Usage]
@@ -21,8 +20,8 @@
21-- > Hello world
20-- > Hello world
22-- > *** Exception: user error (Pattern match failure in do expression at Traced.hs:187:3-9)
21-- > *** Exception: user error (Pattern match failure in do expression at Traced.hs:187:3-9)
23-- > Trace:
22-- > Trace:
24−-- > 0 Left 2
23+-- > 0 Left 2
25−-- > 1 Left 1
24+-- > 1 Left 1
26--
25--
27-- [Guards]
26-- [Guards]
28--
27--
@@ -39,7 +38,7 @@
39-- > *Traced> test2
38-- > *Traced> test2
40-- > *** Exception: user error (Pattern match failure in do expression at Traced.hs:193:3-6)
39-- > *** Exception: user error (Pattern match failure in do expression at Traced.hs:193:3-6)
41-- > Trace:
40-- > Trace:
42−-- > 0 Left 1
41+-- > 0 Left 1
43module Traced ( MonadS(..)
42module Traced ( MonadS(..)
44 , return
43 , return
45 , (>>=)
44 , (>>=)
@@ -53,7 +52,6 @@ module Traced ( MonadS(..)
53
52
54import Prelude hiding ((>>=), return, fail, catch, (>>))
53import Prelude hiding ((>>=), return, fail, catch, (>>))
55import qualified Prelude
54import qualified Prelude
56−import Data.String (fromString)
57import Control.Exception (catches, Handler(..), SomeException, throw, Exception(..), IOException)
55import Control.Exception (catches, Handler(..), SomeException, throw, Exception(..), IOException)
58import Control.Applicative ((<$>))
56import Control.Applicative ((<$>))
59import Data.Typeable (Typeable)
57import Data.Typeable (Typeable)
@@ -182,9 +180,9 @@ instance Show TracedException where
182
180
183traceHandlers :: Traceable a => a -> [Handler b]
181traceHandlers :: Traceable a => a -> [Handler b]
184traceHandlers a = case trace a of
182traceHandlers a = case trace a of
185− Nothing -> [ Handler $ \(ex :: SomeException) -> throw ex ]
183+ Nothing -> [ Handler $ \ex -> throw (ex :: SomeException) ]
186 Just t -> [ Handler $ \(TracedException ts ex) -> throw $ TracedException (show t : ts) ex
184 Just t -> [ Handler $ \(TracedException ts ex) -> throw $ TracedException (show t : ts) ex
187− , Handler $ \(ex :: SomeException) -> throw $ TracedException [show t] ex
185+ , Handler $ \ex -> throw $ TracedException [show t] (ex :: SomeException)
188 ]
186 ]
189
187
190-- | Definition of 'ifThenElse' for use with RebindableSyntax
188-- | Definition of 'ifThenElse' for use with RebindableSyntax