Swift 自定义运算符

来源:互联网 发布:发热丝数据 编辑:程序博客网 时间:2024/06/03 19:36

/// Pipe forward function application.
infix operator |> {associativity left precedence 70}

/// Infix, flipped version of fmap (for arrays), i.e. xs ||> f := f <^> xs
infix operator ||> {associativity left precedence 70}

/// Infix, flipped version of fmap (for optionals), i.e. xs ||> f := f <^> xs
infix operator ?|> {associativity left precedence 70}

/// Composition
infix operator • {associativity left precedence 80}

/// Semigroup binary operation
infix operator <> {associativity left precedence 80}

/// Semigroup operation partially applied on right
prefix operator <> {}

/// Semigroup operation partially applied on left
postfix operator <> {}

/// Lens view
infix operator ^* {associativity left precedence 70}

/// Lens set
infix operator .~ {associativity left precedence 90}

/// Lens over
infix operator %~ {associativity left precedence 90}

/// Lens over with both part and whole.
infix operator %~~ {associativity left precedence 90}

/// Lens semigroup
infix operator <>~ {associativity left precedence 90}

/// Kleisli lens composition
infix operator >•> {}

/// Prism preview
infix operator ^? {associativity left precedence 70}