@@ -205,6 +205,7 @@ module Control.Distributed.Static
205 , staticCompose
205 , staticCompose
206 , staticSplit
206 , staticSplit
207 , staticConst
207 , staticConst
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
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"
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"
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
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
407--------------------------------------------------------------------------------
419--------------------------------------------------------------------------------
408-- Combinators on Closures --
420-- Combinators on Closures --
409--------------------------------------------------------------------------------
421--------------------------------------------------------------------------------