File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ Bugfixes:
1212
1313Other improvements:
1414- Changed ` unit ` 's FFI representation from ` {} ` to ` undefined ` (#267 by @JordanMartinez )
15+ - Clarify docs for ` flip ` (#271 by @JordanMartinez )
1516
1617## [ v5.0.1] ( https://github.com/purescript/purescript-prelude/releases/tag/v5.0.1 ) - 2021-05-11
1718
Original file line number Diff line number Diff line change @@ -13,10 +13,15 @@ import Data.Boolean (otherwise)
1313import Data.Ord ((<=))
1414import Data.Ring ((-))
1515
16- -- | Flips the order of the arguments to a function of two arguments.
16+ -- | Given a function that takes two arguments, applies the arguments
17+ -- | to the function in a swapped order.
1718-- |
1819-- | ```purescript
19- -- | flip const 1 2 = const 2 1 = 2
20+ -- | flip append "1" "2" == append "2" "1" == "21"
21+ -- |
22+ -- | const 1 "two" == 1
23+ -- |
24+ -- | flip const 1 "two" == const "two" 1 == "two"
2025-- | ```
2126flip :: forall a b c . (a -> b -> c ) -> b -> a -> c
2227flip f b a = f a b
You can’t perform that action at this time.
0 commit comments