@@ -205,6 +205,7 @@ module Control.Distributed.Static
205205 , staticCompose
206206 , staticSplit
207207 , staticConst
208+ , staticFlip
208209 -- * Closures
209210 , Closure
210211 , closure
@@ -310,6 +311,7 @@ initRemoteTable =
310311 . registerStatic "$split" (toDynamic ((***) :: (ANY1 -> ANY3) -> (ANY2 -> ANY4) -> (ANY1, ANY2) -> (ANY3, ANY4)))
311312 . registerStatic "$app" (toDynamic (app :: (ANY1 -> ANY2, ANY1) -> ANY2))
312313 . registerStatic "$decodeEnvPair" (toDynamic (decode :: ByteString -> (ByteString, ByteString)))
314+ . registerStatic "$flip" (toDynamic (flip :: (ANY1 -> ANY2 -> ANY3) -> ANY2 -> ANY1 -> ANY3))
313315 $ RemoteTable Map.empty
314316
315317-- | Register a static label
@@ -385,6 +387,11 @@ appStatic :: (Typeable a, Typeable b)
385387 => Static ((a -> b, a) -> b)
386388appStatic = staticLabel "$app"
387389
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+
388395--------------------------------------------------------------------------------
389396-- Combinators on static values --
390397--------------------------------------------------------------------------------
@@ -404,6 +411,11 @@ staticConst :: (Typeable a, Typeable b)
404411 => Static a -> Static (b -> a)
405412staticConst x = constStatic `staticApply` x
406413
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+
407419--------------------------------------------------------------------------------
408420-- Combinators on Closures --
409421--------------------------------------------------------------------------------