:: (a -> b -> c) -> (b -> a -> c) -package:classy-prelude

flip f takes its (first) two arguments in the reverse order of f.
flip f x y = f y x
flip . flip = id

Examples

>>> flip (++) "hello" "world"
"worldhello"
>>> let (.>) = flip (.) in (+1) .> show $ 5
"6"
flip f takes its (first) two arguments in the reverse order of f.
>>> flip (++) "hello" "world"
"worldhello"
Convenience function for supplying arguments to client functions when working with records of clients. Intended to be used in conjunction with (//). Example:
type Api = NamedRoutes RootApi

data RootApi mode = RootApi
{ subApi :: mode :- Capture "token" String :> NamedRoutes SubApi
, hello :: mode :- Capture "name" String :> Get '[JSON] String
, …
} deriving Generic

data SubApi mode = SubApi
{ endpoint :: mode :- Get '[JSON] Person
, …
} deriving Generic

api :: Proxy API
api = Proxy

rootClient :: RootApi (AsClientT ClientM)
rootClient = client api

hello :: String -> ClientM String
hello name = rootClient // hello /: name

endpointClient :: ClientM Person
endpointClient = client // subApi /: "foobar123" // endpoint
Backwards function application. This is an infix synonym for flip
flip f takes its (first) two arguments in the reverse order of f.
flip f takes its (first) two arguments in the reverse order of f.
>>> flip (++) "hello" "world"
"worldhello"
flip f takes its (first) two arguments in the reverse order of f.
flip f x y = f y x
flip . flip = id

Examples

>>> flip (++) "hello" "world"
"worldhello"
>>> let (.>) = flip (.) in (+1) .> show $ 5
"6"
Strict variant of flip. Defined as:
flip f b a = f $! a $! b
Since version 0.11.0.0.
Takes two lists and combines them with a custom combining function