Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Commit

Permalink
Add NFData instances to Closure
Browse files Browse the repository at this point in the history
  • Loading branch information
qnikst committed Mar 18, 2015
1 parent 5c7f843 commit 03efc2d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion distributed-static.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ Library
rank1dynamic >= 0.1 && < 0.3,
containers >= 0.4 && < 0.6,
bytestring >= 0.9 && < 0.11,
binary >= 0.5 && < 0.8
binary >= 0.5 && < 0.8,
deepseq >= 1.3.0.1 && < 1.6
HS-Source-Dirs: src
Default-Language: Haskell2010
Default-Extensions: DeriveDataTypeable
Expand Down
3 changes: 3 additions & 0 deletions src/Control/Distributed/Static.hs
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ import Data.Map (Map)
import qualified Data.Map as Map (lookup, empty, insert)
import Control.Applicative ((<$>), (<*>))
import Control.Arrow as Arrow ((***), app)
import Control.DeepSeq (NFData(rnf))
import Data.Rank1Dynamic (Dynamic, toDynamic, fromDynamic, dynApply)
import Data.Rank1Typeable
( Typeable
Expand Down Expand Up @@ -348,6 +349,8 @@ instance Typeable a => Binary (Closure a) where
put (Closure static env) = put static >> put env
get = Closure <$> get <*> get

instance NFData (Closure a) where rnf x = x `seq` ()

closure :: Static (ByteString -> a) -- ^ Decoder
-> ByteString -- ^ Encoded closure environment
-> Closure a
Expand Down

0 comments on commit 03efc2d

Please sign in to comment.