6
6
// Copyright (c) 2015 TypeLift. All rights reserved.
7
7
// Released under the MIT License.
8
8
//
9
+ // Precedence marks for certain symbols aligned with Runes
10
+ // ~( https://github.com/thoughtbot/Runes/blob/master/Source/Runes.swift ) until Swift gets a proper
11
+ // resolver.
9
12
10
13
// MARK: Combinators
11
14
@@ -18,19 +21,19 @@ infix operator • {
18
21
/// Apply | Applies an argument to a function.
19
22
infix operator § {
20
23
associativity right
21
- precedence 0
24
+ precedence 95
22
25
}
23
26
24
27
/// Pipe Backward | Applies the function to its left to an argument on its right.
25
28
infix operator <| {
26
29
associativity right
27
- precedence 0
30
+ precedence 95
28
31
}
29
32
30
33
/// Pipe forward | Applies an argument on the left to a function on the right.
31
34
infix operator |> {
32
35
associativity left
33
- precedence 0
36
+ precedence 95
34
37
}
35
38
36
39
/// On | Given a "combining" function and a function that converts arguments to the target of the
@@ -47,7 +50,8 @@ infix operator |*| {
47
50
/// Fmap | Maps a function over the value encapsulated by a functor.
48
51
infix operator <^> {
49
52
associativity left
50
- precedence 140
53
+ // https://github.com/thoughtbot/Runes/blob/master/Source/Runes.swift
54
+ precedence 130
51
55
}
52
56
53
57
/// Replace | Maps all the values encapsulated by a functor to a user-specified constant.
@@ -66,7 +70,8 @@ infix operator ^> {
66
70
/// Ap | Applies a function encapsulated by a functor to the value encapsulated by another functor.
67
71
infix operator <*> {
68
72
associativity left
69
- precedence 140
73
+ // https://github.com/thoughtbot/Runes/blob/master/Source/Runes.swift
74
+ precedence 130
70
75
}
71
76
72
77
/// Sequence Right | Disregards the Functor on the Left.
@@ -91,14 +96,16 @@ infix operator <* {
91
96
/// left to a function on the right yielding a new monad.
92
97
infix operator >>- {
93
98
associativity left
94
- precedence 110
99
+ // https://github.com/thoughtbot/Runes/blob/master/Source/Runes.swift
100
+ precedence 100
95
101
}
96
102
97
103
/// Bind Backwards | Composes two monadic actions by passing the value inside the monad on the
98
104
/// right to the funciton on the left.
99
105
infix operator -<< {
100
106
associativity right
101
- precedence 110
107
+ // https://github.com/thoughtbot/Runes/blob/master/Source/Runes.swift
108
+ precedence 100
102
109
}
103
110
104
111
/// Left-to-Right Kleisli | Composition for monads.
0 commit comments