distributed-closure 0.1.0.0 → 0.2.0.0
raw patch · 3 files changed
+19/−3 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Control.Distributed.Closure: [Dict] :: Dict a
- Control.Distributed.Closure.Internal: [Ap] :: !(Closure (a -> b)) -> !(Closure a) -> Closure b
- Control.Distributed.Closure.Internal: [Closure] :: a -> !(Closure a) -> Closure a
- Control.Distributed.Closure.Internal: [Encoded] :: !ByteString -> Closure ByteString
- Control.Distributed.Closure.Internal: [StaticPtr] :: !(StaticPtr a) -> Closure a
+ Control.Distributed.Closure: Dict :: Dict a
+ Control.Distributed.Closure.Internal: Ap :: !(Closure (a -> b)) -> !(Closure a) -> Closure b
+ Control.Distributed.Closure.Internal: Closure :: a -> !(Closure a) -> Closure a
+ Control.Distributed.Closure.Internal: Encoded :: !ByteString -> Closure ByteString
+ Control.Distributed.Closure.Internal: StaticPtr :: !(StaticPtr a) -> Closure a
+ Control.Distributed.Closure.TH: cstatic :: Name -> ExpQ
Files
- distributed-closure.cabal +1/−1
- src/Control/Distributed/Closure/Internal.hs +1/−1
- src/Control/Distributed/Closure/TH.hs +17/−1
distributed-closure.cabal view
@@ -1,5 +1,5 @@ name: distributed-closure-version: 0.1.0.0+version: 0.2.0.0 synopsis: Serializable closures for distributed programming. description: See README. homepage: https://github.com/tweag/distributed-closure
src/Control/Distributed/Closure/Internal.hs view
@@ -43,7 +43,7 @@ StaticPtr :: !(StaticPtr a) -> Closure a Encoded :: !ByteString -> Closure ByteString Ap :: !(Closure (a -> b)) -> !(Closure a) -> Closure b- -- | Cache the value a closure resolves to.+ -- Cache the value a closure resolves to. Closure :: a -> !(Closure a) -> Closure a -- Will be obsoleted by https://ghc.haskell.org/trac/ghc/wiki/Typeable. We use
src/Control/Distributed/Closure/TH.hs view
@@ -1,7 +1,7 @@ {-# LANGUAGE StaticPointers #-} {-# LANGUAGE TemplateHaskell #-} --- | Utility Template Haskell functions.+-- | Utility Template Haskell macros. module Control.Distributed.Closure.TH where @@ -11,9 +11,25 @@ import qualified Language.Haskell.TH as TH import Numeric.Natural +-- | @$(cstatic 'foo)@ is an abbreviation for @closure (static foo)@.+cstatic :: TH.Name -> TH.ExpQ+cstatic f = [| closure (static $(TH.varE f)) |]++-- | Abbreviation for @closure (static Dict)@. Example usage:+--+-- @+-- foo :: Closure (Dict (Num a)) -> ...+--+-- foo $cdict ...+-- @ cdict :: TH.ExpQ cdict = cdictFrom 0 +-- | Create a static dictionary from the given dictionaries. Example usage:+--+-- @+-- $cdictFrom 2 Dict Dict :: Closure (Static (Dict (Eq a, Show a)))+-- @ cdictFrom :: Natural -> TH.ExpQ cdictFrom n0 = apply abstract [| closure (static $(staticFun n0)) |] n0 where