git.iko.soy/distributed-process
on master help sign in
Support staticFlip.
5ad2786Edsko de Vries
distributed-static/ChangeLog+4
@@ -1,3 +1,7 @@
1+<<date>> Edsko de Vries <edsko@well-typed.com> 0.2.1
2+
3+* Add support for 'staticFlip'
4+
12012-08-16 Edsko de Vries <edsko@well-typed.com> 0.2
52012-08-16 Edsko de Vries <edsko@well-typed.com> 0.2
2
6
3* Hide the 'Closure' constructor and export 'closure' instead so that we are
7* Hide the 'Closure' constructor and export 'closure' instead so that we are
distributed-static/distributed-static.cabal+1−1
@@ -1,5 +1,5 @@
1Name: distributed-static
1Name: distributed-static
2−Version: 0.2.0.0
2+Version: 0.2.1
3Synopsis: Compositional, type-safe, polymorphic static values and closures
3Synopsis: Compositional, type-safe, polymorphic static values and closures
4Description: /Towards Haskell in the Cloud/ (Epstein et al, Haskell
4Description: /Towards Haskell in the Cloud/ (Epstein et al, Haskell
5 Symposium 2011) introduces the concept of /static/ values:
5 Symposium 2011) introduces the concept of /static/ values:
distributed-static/src/Control/Distributed/Static.hs+12
@@ -205,6 +205,7 @@ module Control.Distributed.Static
205 , staticCompose
205 , staticCompose
206 , staticSplit
206 , staticSplit
207 , staticConst
207 , staticConst
208+ , staticFlip
208 -- * Closures
209 -- * Closures
209 , Closure
210 , Closure
210 , closure
211 , closure
@@ -310,6 +311,7 @@ initRemoteTable =
310 . registerStatic "$split" (toDynamic ((***) :: (ANY1 -> ANY3) -> (ANY2 -> ANY4) -> (ANY1, ANY2) -> (ANY3, ANY4)))
311 . registerStatic "$split" (toDynamic ((***) :: (ANY1 -> ANY3) -> (ANY2 -> ANY4) -> (ANY1, ANY2) -> (ANY3, ANY4)))
311 . registerStatic "$app" (toDynamic (app :: (ANY1 -> ANY2, ANY1) -> ANY2))
312 . registerStatic "$app" (toDynamic (app :: (ANY1 -> ANY2, ANY1) -> ANY2))
312 . registerStatic "$decodeEnvPair" (toDynamic (decode :: ByteString -> (ByteString, ByteString)))
313 . registerStatic "$decodeEnvPair" (toDynamic (decode :: ByteString -> (ByteString, ByteString)))
314+ . registerStatic "$flip" (toDynamic (flip :: (ANY1 -> ANY2 -> ANY3) -> ANY2 -> ANY1 -> ANY3))
313 $ RemoteTable Map.empty
315 $ RemoteTable Map.empty
314
316
315-- | Register a static label
317-- | Register a static label
@@ -385,6 +387,11 @@ appStatic :: (Typeable a, Typeable b)
385 => Static ((a -> b, a) -> b)
387 => Static ((a -> b, a) -> b)
386appStatic = staticLabel "$app"
388appStatic = staticLabel "$app"
387
389
390+-- | Static version of 'flip'
391+flipStatic :: (Typeable a, Typeable b, Typeable c)
392+ => Static ((a -> b -> c) -> b -> a -> c)
393+flipStatic = staticLabel "$flip"
394+
388--------------------------------------------------------------------------------
395--------------------------------------------------------------------------------
389-- Combinators on static values --
396-- Combinators on static values --
390--------------------------------------------------------------------------------
397--------------------------------------------------------------------------------
@@ -404,6 +411,11 @@ staticConst :: (Typeable a, Typeable b)
404 => Static a -> Static (b -> a)
411 => Static a -> Static (b -> a)
405staticConst x = constStatic `staticApply` x
412staticConst x = constStatic `staticApply` x
406
413
414+-- | Static version of 'Prelude.flip'
415+staticFlip :: (Typeable a, Typeable b, Typeable c)
416+ => Static (a -> b -> c) -> Static (b -> a -> c)
417+staticFlip f = flipStatic `staticApply` f
418+
407--------------------------------------------------------------------------------
419--------------------------------------------------------------------------------
408-- Combinators on Closures --
420-- Combinators on Closures --
409--------------------------------------------------------------------------------
421--------------------------------------------------------------------------------