-
Notifications
You must be signed in to change notification settings - Fork 1.2k
flip vs Function.swap #36902
Copy link
Copy link
Open
Description
-- Defined in `Init.Core`
def flip {α β : Sort*} {γ : Sort*} (f : α → β → γ) : β → α → φ :=
fun b a ↦ f a b
-- Defined in `Mathlib.Logic.Function.Defs`
abbrev Function.swap {α β : Sort*} {φ : α → β → Sort*} (f : Π x y, φ x y) : Π y x, φ x y :=
fun y x ↦ f x yThese are almost the same, and both have a non-negligible number of related APIs(flip: 72, Function.swap: 165).
These should be unified.
Personally, I think these should be unified to flip, since it is defined in the core library, and Function.swap is easily confused with Prod.swap.
Updated: α and β in flip is Sort*, not Type*.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels