distributed-static 0.2.0.0 → 0.2.1
raw patch · 2 files changed
+15/−3 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Control.Distributed.Static: staticFlip :: (Typeable a, Typeable b, Typeable c) => Static (a -> b -> c) -> Static (b -> a -> c)
Files
distributed-static.cabal view
@@ -1,5 +1,5 @@ Name: distributed-static-Version: 0.2.0.0+Version: 0.2.1 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:
src/Control/Distributed/Static.hs view
@@ -104,7 +104,7 @@ -- We can now define 'sendIntClosure': -- -- > sendIntClosure :: ProcessId -> Closure (Int -> Process ())--- > sendIntClosure pid = Closure decoder (encode pid)+-- > sendIntClosure pid = closure decoder (encode pid) -- > where -- > decoder :: Static (ByteString -> Int -> Process ()) -- > decoder = sendIntStatic `staticCompose` decodeProcessIdStatic@@ -169,7 +169,7 @@ -- so that we can define -- -- > sendClosure :: Static (BinaryDict a) -> Process a -> Closure (a -> Process ())--- > sendClosure dict pid = Closure decoder (encode pid)+-- > sendClosure dict pid = closure decoder (encode pid) -- > where -- > decoder :: Static (ByteString -> a -> Process ()) -- > decoder = (sendDictStatic `staticApply` dict) `staticCompose` decodeProcessIdStatic @@ -205,6 +205,7 @@ , staticCompose , staticSplit , staticConst+ , staticFlip -- * Closures , Closure , closure@@ -310,6 +311,7 @@ . registerStatic "$split" (toDynamic ((***) :: (ANY1 -> ANY3) -> (ANY2 -> ANY4) -> (ANY1, ANY2) -> (ANY3, ANY4))) . registerStatic "$app" (toDynamic (app :: (ANY1 -> ANY2, ANY1) -> ANY2)) . registerStatic "$decodeEnvPair" (toDynamic (decode :: ByteString -> (ByteString, ByteString)))+ . registerStatic "$flip" (toDynamic (flip :: (ANY1 -> ANY2 -> ANY3) -> ANY2 -> ANY1 -> ANY3)) $ RemoteTable Map.empty -- | Register a static label@@ -385,6 +387,11 @@ => Static ((a -> b, a) -> b) appStatic = staticLabel "$app" +-- | Static version of 'flip'+flipStatic :: (Typeable a, Typeable b, Typeable c)+ => Static ((a -> b -> c) -> b -> a -> c)+flipStatic = staticLabel "$flip" + -------------------------------------------------------------------------------- -- Combinators on static values -- --------------------------------------------------------------------------------@@ -403,6 +410,11 @@ staticConst :: (Typeable a, Typeable b) => Static a -> Static (b -> a) staticConst x = constStatic `staticApply` x ++-- | Static version of 'Prelude.flip'+staticFlip :: (Typeable a, Typeable b, Typeable c)+ => Static (a -> b -> c) -> Static (b -> a -> c)+staticFlip f = flipStatic `staticApply` f -------------------------------------------------------------------------------- -- Combinators on Closures --