packages feed

distributed-static 0.3.1.0 → 0.3.2.0

raw patch · 3 files changed

+28/−4 lines, 3 filesdep +deepseqdep ~rank1dynamicnew-uploaderPVP ok

version bump matches the API change (PVP)

Dependencies added: deepseq

Dependency ranges changed: rank1dynamic

API changes (from Hackage documentation)

+ Control.Distributed.Static: instance NFData (Closure a)
+ Control.Distributed.Static: instance NFData (Static a)
+ Control.Distributed.Static: instance NFData StaticLabel

Files

ChangeLog view
@@ -1,3 +1,8 @@+2015-06-15  Facundo Domínguez  <facundo.dominguez@tweag.io>  0.3.2.0++* Loosen rank1dynamic bounds.+* Add NFData instances.+ 2014-12-09  Tim Watson  <watson.timothy@gmail.com>  0.3.1.0  * Eq and Ord instances for Closure and Static
distributed-static.cabal view
@@ -1,5 +1,5 @@ Name:                distributed-static-Version:             0.3.1.0+Version:             0.3.2.0 Synopsis:            Compositional, type-safe, polymorphic static values and closures  Description:         /Towards Haskell in the Cloud/ (Epstein et al, Haskell                      Symposium 2011) introduces the concept of /static/ values:@@ -18,7 +18,7 @@ License:             BSD3 License-File:        LICENSE Author:              Edsko de Vries-Maintainer:          edsko@well-typed.com, watson.timothy@gmail.com+Maintainer:          Facundo Domínguez <facundo.dominguez@tweag.io> Bug-Reports:         https://cloud-haskell.atlassian.net/browse/DS Copyright:           Well-Typed LLP Category:            Control@@ -33,10 +33,11 @@ Library   Exposed-Modules:     Control.Distributed.Static   Build-Depends:       base >= 4 && < 5,-                       rank1dynamic >= 0.1 && < 0.3,+                       rank1dynamic >= 0.1 && < 0.4,                        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
src/Control/Distributed/Static.hs view
@@ -196,6 +196,7 @@ -- >   where -- >     sdictSendPort :: forall a. SerializableDict a -> SerializableDict (SendPort a) -- >     sdictSendPort SerializableDict = SerializableDict+{-# LANGUAGE CPP #-} module Control.Distributed.Static   ( -- * Static values     Static@@ -233,10 +234,14 @@   , decode   ) import Data.ByteString.Lazy (ByteString, empty)+#if ! MIN_VERSION_bytestring(0,10,0)+import Data.ByteString.Lazy as BSL+#endif 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@@ -257,10 +262,17 @@   | StaticApply StaticLabel StaticLabel   deriving (Eq, Ord, Typeable, Show) +instance NFData StaticLabel where+  rnf (StaticLabel s) = rnf s+  rnf (StaticApply a b) = rnf a `seq` rnf b+ -- | A static value. Static is opaque; see 'staticLabel' and 'staticApply'. newtype Static a = Static StaticLabel   deriving (Eq, Ord, Typeable, Show) +instance NFData (Static a) where+  rnf (Static s) = rnf s+ instance Typeable a => Binary (Static a) where   put (Static label) = putStaticLabel label >> put (typeOf (undefined :: a))   get = do@@ -347,6 +359,12 @@ instance Typeable a => Binary (Closure a) where   put (Closure static env) = put static >> put env   get = Closure <$> get <*> get++#if MIN_VERSION_bytestring(0,10,0)+instance NFData (Closure a) where rnf (Closure f b) = rnf f `seq` rnf b+#else+instance NFData (Closure a) where rnf (Closure f b) = rnf f `seq` BSL.length b `seq` ()+#endif  closure :: Static (ByteString -> a) -- ^ Decoder         -> ByteString               -- ^ Encoded closure environment