Skip to content

Commit 226a675

Browse files
committed
Update more tests to use ()'s around function types.
1 parent c990fc1 commit 226a675

24 files changed

+85
-85
lines changed

test/IRGen/class_isa_pointers.sil

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ sil_vtable Purebred {}
2424
// CHECK: getelementptr inbounds {{.*}} [[VTABLE]]
2525
sil @purebred_method : $@convention(thin) (@owned Purebred) -> () {
2626
entry(%0 : $Purebred):
27-
%m = class_method %0 : $Purebred, #Purebred.method!1 : Purebred -> () -> (), $@convention(method) (@guaranteed Purebred) -> ()
27+
%m = class_method %0 : $Purebred, #Purebred.method!1 : (Purebred) -> () -> (), $@convention(method) (@guaranteed Purebred) -> ()
2828
%z = apply %m(%0) : $@convention(method) (@guaranteed Purebred) -> ()
2929
return %z : $()
3030
}
@@ -48,7 +48,7 @@ sil_vtable Mongrel {}
4848
// CHECK: getelementptr inbounds {{.*}} [[VTABLE]]
4949
sil @mongrel_method : $@convention(thin) (@owned Mongrel) -> () {
5050
entry(%0 : $Mongrel):
51-
%m = class_method %0 : $Mongrel, #Mongrel.method!1 : Mongrel -> () -> (), $@convention(method) (@guaranteed Mongrel) -> ()
51+
%m = class_method %0 : $Mongrel, #Mongrel.method!1 : (Mongrel) -> () -> (), $@convention(method) (@guaranteed Mongrel) -> ()
5252
%z = apply %m(%0) : $@convention(method) (@guaranteed Mongrel) -> ()
5353
return %z : $()
5454
}

test/IRGen/dynamic_init.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ bb0(%0 : $@thick C.Type):
2424
// CHECK: [[CTOR:%[0-9]+]] = load %C12dynamic_init1C* (%swift.type*)*, %C12dynamic_init1C* (%swift.type*)** [[VTABLE_OFFSET]], align 8
2525
// CHECK: [[CTOR_I8:%[0-9]+]] = bitcast %C12dynamic_init1C* (%swift.type*)* [[CTOR]] to i8*
2626
// CHECK: [[CTOR_FN:%[0-9]+]] = bitcast i8* [[CTOR_I8]] to %C12dynamic_init1C* (%swift.type*)*
27-
%2 = class_method %0 : $@thick C.Type, #C.init!allocator.1 : C.Type -> () -> C , $@convention(method) (@thick C.Type) -> @owned C
27+
%2 = class_method %0 : $@thick C.Type, #C.init!allocator.1 : (C.Type) -> () -> C , $@convention(method) (@thick C.Type) -> @owned C
2828
// CHECK: [[RESULT:%[0-9]+]] = call %C12dynamic_init1C* [[CTOR_FN]](%swift.type* %0)
2929
%3 = apply %2(%0) : $@convention(method) (@thick C.Type) -> @owned C
3030
// CHECK: call void bitcast (void (%swift.refcounted*)* @rt_swift_release to void (%C12dynamic_init1C*)*)(%C12dynamic_init1C* [[RESULT]])
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// RUN: %target-swift-frontend -emit-ir %s
22

33
enum Singleton {
4-
case F(Singleton -> ())
4+
case F((Singleton) -> ())
55
}
66

77
enum Single {
8-
case F(Single -> ())
8+
case F((Single) -> ())
99
case X
1010
case Y
1111
}
1212

1313
enum Multi {
14-
case F(Multi -> ())
15-
case G(Multi -> ())
14+
case F((Multi) -> ())
15+
case G((Multi) -> ())
1616
}

test/IRGen/enum_resilience.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,10 @@ public func resilientSwitchTest(_ m: Medium) -> Int {
190190
}
191191
}
192192

193-
public func reabstraction<T>(_ f: Medium -> T) {}
193+
public func reabstraction<T>(_ f: (Medium) -> T) {}
194194

195195
// CHECK-LABEL: define{{( protected)?}} void @_TF15enum_resilience25resilientEnumPartialApplyFFO14resilient_enum6MediumSiT_(i8*, %swift.refcounted*)
196-
public func resilientEnumPartialApply(_ f: Medium -> Int) {
196+
public func resilientEnumPartialApply(_ f: (Medium) -> Int) {
197197

198198
// CHECK: [[CONTEXT:%.*]] = call noalias %swift.refcounted* @rt_swift_allocObject
199199
// CHECK: call void @_TF15enum_resilience13reabstractionurFFO14resilient_enum6MediumxT_(i8* bitcast (void (%Si*, %swift.opaque*, %swift.refcounted*)* @_TPA__TTRXFo_iO14resilient_enum6Medium_dSi_XFo_iS0__iSi_ to i8*), %swift.refcounted* [[CONTEXT:%.*]], %swift.type* @_TMSi)

test/IRGen/exactcast2.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ sil @_TFC4main4HashCfMS0_FT_S0_ : $@convention(thin) (@thick Hash.Type) -> @owne
2626

2727
sil @_TFC4main4Hash6updatefS0_FT_T_ : $@convention(method) (@guaranteed Hash) -> () {
2828
bb0(%0 : $Hash):
29-
%1 = class_method %0 : $Hash, #Hash.hash!1 : Hash -> () -> () , $@convention(method) (@guaranteed Hash) -> () // user: %9
29+
%1 = class_method %0 : $Hash, #Hash.hash!1 : (Hash) -> () -> () , $@convention(method) (@guaranteed Hash) -> () // user: %9
3030
checked_cast_br [exact] %0 : $Hash to $MD5, bb2, bb3 // id: %2
3131

3232
bb1: // Preds: bb2 bb3

test/IRGen/objc_bridge.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,5 +199,5 @@ class Bas : NSObject {
199199
func ==(lhs: Bas, rhs: Bas) -> Bool { return true }
200200

201201
class OptionalBlockProperty: NSObject {
202-
var x: ([AnyObject] -> [AnyObject])?
202+
var x: (([AnyObject]) -> [AnyObject])?
203203
}

test/IRGen/objc_dealloc.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ bb0(%0 : $SwiftGizmo):
101101
// CHECK-NEXT: store %objc_class* [[T1]], %objc_class** [[OBJC_SUPER_CLASS]], align 8
102102
// CHECK-NEXT: [[DEALLOC_SEL:%[a-zA-Z0-9]+]] = load i8*, i8** @"\01L_selector(dealloc)", align 8
103103
// CHECK-NEXT: call void bitcast (void ()* @objc_msgSendSuper2 to void (%objc_super*, i8*)*)(%objc_super* [[OBJC_SUPER]], i8* [[DEALLOC_SEL]])
104-
%5 = super_method %0 : $SwiftGizmo, #Gizmo.deinit!deallocator.foreign : Gizmo -> () , $@convention(objc_method) (Gizmo) -> () // user: %7
104+
%5 = super_method %0 : $SwiftGizmo, #Gizmo.deinit!deallocator.foreign : (Gizmo) -> () , $@convention(objc_method) (Gizmo) -> () // user: %7
105105
%6 = upcast %0 : $SwiftGizmo to $Gizmo // user: %7
106106
%7 = apply %5(%6) : $@convention(objc_method) (Gizmo) -> ()
107107

test/IRGen/objc_factory_method.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ sil @_TFCSo4HiveCfMS_FT5queenGSQCSo3Bee__S_ : $@convention(thin) (@owned Implici
2222
bb0(%0 : $ImplicitlyUnwrappedOptional<Bee>, %1 : $@thick Hive.Type):
2323
%2 = thick_to_objc_metatype %1 : $@thick Hive.Type to $@objc_metatype Hive.Type // users: %3, %4
2424
// CHECK: load i8*, i8** @"\01L_selector(hiveWithQueen:)"
25-
%3 = class_method %2 : $@objc_metatype Hive.Type, #Hive.init!allocator.1.foreign : Hive.Type -> (queen: ImplicitlyUnwrappedOptional<Bee>) -> Hive! , $@convention(objc_method) (ImplicitlyUnwrappedOptional<Bee>, @objc_metatype Hive.Type) -> @autoreleased ImplicitlyUnwrappedOptional<Hive> // user: %4
25+
%3 = class_method %2 : $@objc_metatype Hive.Type, #Hive.init!allocator.1.foreign : (Hive.Type) -> (queen: ImplicitlyUnwrappedOptional<Bee>) -> Hive! , $@convention(objc_method) (ImplicitlyUnwrappedOptional<Bee>, @objc_metatype Hive.Type) -> @autoreleased ImplicitlyUnwrappedOptional<Hive> // user: %4
2626
// CHECK: call {{.*}} @objc_msgSend
2727
%4 = apply %3(%0, %2) : $@convention(objc_method) (ImplicitlyUnwrappedOptional<Bee>, @objc_metatype Hive.Type) -> @autoreleased ImplicitlyUnwrappedOptional<Hive> // users: %5, %6
2828
// CHECK: call {{.*}} @objc_autorelease

test/IRGen/objc_methods.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Foundation
1010
// Protocol methods require extended method type encodings to capture block
1111
// signatures and parameter object types.
1212
@objc protocol Fooable {
13-
func block(_: Int -> Int)
13+
func block(_: (Int) -> Int)
1414
func block2(_: (Int,Int) -> Int)
1515

1616
func takesString(_: String) -> String
@@ -23,7 +23,7 @@ class Foo: Fooable {
2323
func bar() {}
2424
@objc func baz() {}
2525
@IBAction func garply(_: AnyObject?) {}
26-
@objc func block(_: Int -> Int) {}
26+
@objc func block(_: (Int) -> Int) {}
2727
@objc func block2(_: (Int,Int) -> Int) {}
2828

2929
@objc func takesString(_ x: String) -> String { return x }

test/IRGen/objc_type_encoding.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func testArchetype(_ work: P3) {
117117
// CHECK-ios: private unnamed_addr constant [11 x i8] c"v24@0:8@16\00"
118118
// CHECK-tvos: private unnamed_addr constant [11 x i8] c"v24@0:8@16\00"
119119

120-
@objc func foo(_ x: Int -> Int) -> Int {
120+
@objc func foo(_ x: (Int) -> Int) -> Int {
121121
return 1
122122
}
123123
// CHECK-macosx: private unnamed_addr constant [12 x i8] c"q24@0:8@?16\00"

test/IRGen/partial_apply.sil

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ entry(%f : $@callee_owned (Builtin.Word) -> (), %x : $Builtin.Word):
102102

103103
sil @objc_partial_apply : $@convention(thin) ObjCClass -> @callee_owned Int -> () {
104104
entry(%c : $ObjCClass):
105-
%m = class_method [volatile] %c : $ObjCClass, #ObjCClass.method!1.foreign : ObjCClass -> (x: Int) -> () , $@convention(objc_method) (Int, ObjCClass) -> ()
105+
%m = class_method [volatile] %c : $ObjCClass, #ObjCClass.method!1.foreign : (ObjCClass) -> (x: Int) -> () , $@convention(objc_method) (Int, ObjCClass) -> ()
106106
%p = partial_apply %m(%c) : $@convention(objc_method) (Int, ObjCClass) -> ()
107107
return %p : $@callee_owned Int -> ()
108108
}
@@ -123,7 +123,7 @@ entry(%c : $ObjCClass):
123123

124124
sil @objc_partial_apply_consumes_self : $@convention(thin) ObjCClass -> @callee_owned () -> @owned ObjCClass {
125125
entry(%c : $ObjCClass):
126-
%m = class_method [volatile] %c : $ObjCClass, #ObjCClass.initFamily!1.foreign : ObjCClass -> () -> ObjCClass , $@convention(objc_method) (@owned ObjCClass) -> @owned ObjCClass
126+
%m = class_method [volatile] %c : $ObjCClass, #ObjCClass.initFamily!1.foreign : (ObjCClass) -> () -> ObjCClass , $@convention(objc_method) (@owned ObjCClass) -> @owned ObjCClass
127127
%p = partial_apply %m(%c) : $@convention(objc_method) (@owned ObjCClass) -> @owned ObjCClass
128128
return %p : $@callee_owned () -> @owned ObjCClass
129129
}

test/IRGen/partial_apply_generic.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ infix operator ~> { precedence 255 }
99

1010
func ~> <Target, Args, Result> (
1111
target: Target,
12-
method: Target -> Args -> Result)
13-
-> Args -> Result
12+
method: (Target) -> (Args) -> Result)
13+
-> (Args) -> Result
1414
{
1515
return method(target)
1616
}
@@ -25,8 +25,8 @@ struct Spoon: Runcible {
2525
typealias Element = Mince
2626
}
2727

28-
func split<Seq: Runcible>(_ seq: Seq) -> (Seq.Element -> Bool) -> () {
29-
return {(isSeparator: Seq.Element -> Bool) in
28+
func split<Seq: Runcible>(_ seq: Seq) -> ((Seq.Element) -> Bool) -> () {
29+
return {(isSeparator: (Seq.Element) -> Bool) in
3030
return ()
3131
}
3232
}

test/IRGen/struct_resilience.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import resilient_enum
1313

1414
// CHECK-LABEL: define{{( protected)?}} void @_TF17struct_resilience26functionWithResilientTypesFTV16resilient_struct4Size1fFS1_S1__S1_(%swift.opaque* noalias nocapture sret, %swift.opaque* noalias nocapture, i8*, %swift.refcounted*)
1515

16-
public func functionWithResilientTypes(_ s: Size, f: Size -> Size) -> Size {
16+
public func functionWithResilientTypes(_ s: Size, f: (Size) -> Size) -> Size {
1717

1818
// CHECK: [[RESULT:%.*]] = alloca [[BUFFER_TYPE:\[.* x i8\]]]
1919

@@ -82,7 +82,7 @@ public struct MySize {
8282
}
8383

8484
// CHECK-LABEL: define{{( protected)?}} void @_TF17struct_resilience28functionWithMyResilientTypesFTVS_6MySize1fFS0_S0__S0_(%V17struct_resilience6MySize* {{.*}}, %V17struct_resilience6MySize* {{.*}}, i8*, %swift.refcounted*)
85-
public func functionWithMyResilientTypes(_ s: MySize, f: MySize -> MySize) -> MySize {
85+
public func functionWithMyResilientTypes(_ s: MySize, f: (MySize) -> MySize) -> MySize {
8686

8787
// CHECK: [[TEMP:%.*]] = alloca %V17struct_resilience6MySize
8888
// CHECK: bitcast

test/IRGen/super.sil

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ bb0(%0 : $ChildToResilientParent):
4343
debug_value %0 : $ChildToResilientParent, let, name "self", argno 1
4444
strong_retain %0 : $ChildToResilientParent
4545
%3 = upcast %0 : $ChildToResilientParent to $ResilientOutsideParent
46-
%4 = super_method %0 : $ChildToResilientParent, #ResilientOutsideParent.method!1 : ResilientOutsideParent -> () -> () , $@convention(method) (@guaranteed ResilientOutsideParent) -> ()
46+
%4 = super_method %0 : $ChildToResilientParent, #ResilientOutsideParent.method!1 : (ResilientOutsideParent) -> () -> () , $@convention(method) (@guaranteed ResilientOutsideParent) -> ()
4747
%5 = apply %4(%3) : $@convention(method) (@guaranteed ResilientOutsideParent) -> ()
4848
strong_release %3 : $ResilientOutsideParent
4949
%7 = tuple ()
@@ -63,7 +63,7 @@ sil @_TZFC5super22ChildToResilientParent11classMethodfT_T_ : $@convention(method
6363
bb0(%0 : $@thick ChildToResilientParent.Type):
6464
debug_value %0 : $@thick ChildToResilientParent.Type, let, name "self", argno 1
6565
%2 = upcast %0 : $@thick ChildToResilientParent.Type to $@thick ResilientOutsideParent.Type
66-
%3 = super_method %0 : $@thick ChildToResilientParent.Type, #ResilientOutsideParent.classMethod!1 : ResilientOutsideParent.Type -> () -> () , $@convention(method) (@thick ResilientOutsideParent.Type) -> ()
66+
%3 = super_method %0 : $@thick ChildToResilientParent.Type, #ResilientOutsideParent.classMethod!1 : (ResilientOutsideParent.Type) -> () -> () , $@convention(method) (@thick ResilientOutsideParent.Type) -> ()
6767
%4 = apply %3(%2) : $@convention(method) (@thick ResilientOutsideParent.Type) -> ()
6868
%5 = tuple ()
6969
return %5 : $()
@@ -90,7 +90,7 @@ bb0(%0 : $ChildToFixedParent):
9090
debug_value %0 : $ChildToFixedParent, let, name "self", argno 1
9191
strong_retain %0 : $ChildToFixedParent
9292
%3 = upcast %0 : $ChildToFixedParent to $OutsideParent
93-
%4 = super_method %0 : $ChildToFixedParent, #OutsideParent.method!1 : OutsideParent -> () -> () , $@convention(method) (@guaranteed OutsideParent) -> ()
93+
%4 = super_method %0 : $ChildToFixedParent, #OutsideParent.method!1 : (OutsideParent) -> () -> () , $@convention(method) (@guaranteed OutsideParent) -> ()
9494
%5 = apply %4(%3) : $@convention(method) (@guaranteed OutsideParent) -> ()
9595
strong_release %3 : $OutsideParent
9696
%7 = tuple ()
@@ -110,7 +110,7 @@ sil @_TZFC5super18ChildToFixedParent11classMethodfT_T_ : $@convention(method) (@
110110
bb0(%0 : $@thick ChildToFixedParent.Type):
111111
debug_value %0 : $@thick ChildToFixedParent.Type, let, name "self", argno 1
112112
%2 = upcast %0 : $@thick ChildToFixedParent.Type to $@thick OutsideParent.Type
113-
%3 = super_method %0 : $@thick ChildToFixedParent.Type, #OutsideParent.classMethod!1 : OutsideParent.Type -> () -> () , $@convention(method) (@thick OutsideParent.Type) -> ()
113+
%3 = super_method %0 : $@thick ChildToFixedParent.Type, #OutsideParent.classMethod!1 : (OutsideParent.Type) -> () -> () , $@convention(method) (@thick OutsideParent.Type) -> ()
114114
%4 = apply %3(%2) : $@convention(method) (@thick OutsideParent.Type) -> ()
115115
%5 = tuple ()
116116
return %5 : $()
@@ -131,7 +131,7 @@ bb0(%0 : $ResilientOutsideChild):
131131
debug_value %0 : $ResilientOutsideChild, let, name "self", argno 1
132132
strong_retain %0 : $ResilientOutsideChild
133133
%3 = upcast %0 : $ResilientOutsideChild to $ResilientOutsideParent
134-
%4 = super_method %0 : $ResilientOutsideChild, #ResilientOutsideParent.method!1 : ResilientOutsideParent -> () -> () , $@convention(method) (@guaranteed ResilientOutsideParent) -> ()
134+
%4 = super_method %0 : $ResilientOutsideChild, #ResilientOutsideParent.method!1 : (ResilientOutsideParent) -> () -> () , $@convention(method) (@guaranteed ResilientOutsideParent) -> ()
135135
%5 = apply %4(%3) : $@convention(method) (@guaranteed ResilientOutsideParent) -> ()
136136
strong_release %3 : $ResilientOutsideParent
137137
%7 = tuple ()
@@ -155,7 +155,7 @@ sil @_TZFE5superC15resilient_class21ResilientOutsideChild20callSuperClassMethodf
155155
bb0(%0 : $@thick ResilientOutsideChild.Type):
156156
debug_value %0 : $@thick ResilientOutsideChild.Type, let, name "self", argno 1
157157
%2 = upcast %0 : $@thick ResilientOutsideChild.Type to $@thick ResilientOutsideParent.Type
158-
%3 = super_method %0 : $@thick ResilientOutsideChild.Type, #ResilientOutsideParent.classMethod!1 : ResilientOutsideParent.Type -> () -> () , $@convention(method) (@thick ResilientOutsideParent.Type) -> ()
158+
%3 = super_method %0 : $@thick ResilientOutsideChild.Type, #ResilientOutsideParent.classMethod!1 : (ResilientOutsideParent.Type) -> () -> () , $@convention(method) (@thick ResilientOutsideParent.Type) -> ()
159159
%4 = apply %3(%2) : $@convention(method) (@thick ResilientOutsideParent.Type) -> ()
160160
%5 = tuple ()
161161
return %5 : $()

test/Interpreter/SDK/block_calls.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ class Foo : NSObject {
1313
super.init()
1414
}
1515

16-
@objc func applyBlock(_ f: Int -> (), withInt x: Int) {
16+
@objc func applyBlock(_ f: (Int) -> (), withInt x: Int) {
1717
f(foo)
1818
f(x)
1919
}
2020

21-
@objc func applyBlock(_ f: Int -> (), withFoo x: Foo) {
21+
@objc func applyBlock(_ f: (Int) -> (), withFoo x: Foo) {
2222
f(foo)
2323
f(x.foo)
2424
}

test/Interpreter/SDK/objc_block_generic.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
import Foundation
77

88
autoreleasepool {
9-
let f: @convention(block) Int -> Int = { $0 }
9+
let f: @convention(block) (Int) -> Int = { $0 }
1010
// In an -Onone build this instantiates the generic metadata for
1111
// @convention(block) Int -> Int
12-
let ff: (@convention(block) Int -> Int)? = f
12+
let ff: (@convention(block) (Int) -> Int)? = f
1313
let gg = ff
1414

1515
// CHECK: 219

test/Interpreter/closures.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ func test() {
3535
test()
3636

3737
// <rdar://problem/19776288>
38-
func map<T>(_ fn: T -> ()) {
38+
func map<T>(_ fn: (T) -> ()) {
3939
print("Void overload")
4040
}
4141

42-
func map<T,U>(_ fn: T -> U) {
42+
func map<T,U>(_ fn: (T) -> U) {
4343
print("Non-void overload")
4444
}
4545

test/Interpreter/currying_generics.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ print(clampFoo2(n: 3.0)) // CHECK-NEXT: 10.0
101101

102102
// rdar://problem/19195470
103103

104-
func pair<T,U> (_ a: T) -> U -> (T,U) {
104+
func pair<T,U> (_ a: T) -> (U) -> (T,U) {
105105
return { b in (a,b) }
106106
}
107107

@@ -110,7 +110,7 @@ func pair_<T,U> (_ a: T) -> (b: U) -> (T,U) {
110110
}
111111

112112
infix operator <+> { }
113-
func <+><T,U,V> (lhs: T?, rhs: T -> U -> V) -> U -> V? {
113+
func <+><T,U,V> (lhs: T?, rhs: (T) -> (U) -> V) -> (U) -> V? {
114114
if let x = lhs {
115115
return { y in .some(rhs(x)(y)) }
116116
} else {
@@ -130,11 +130,11 @@ print((b <+> pair_)(a!)) // CHECK-NEXT: (42, 23)
130130
struct Identity<A> { let value: A }
131131
struct Const<A, B> { let value: A }
132132

133-
func fmap<A, B>(_ f: A -> B) -> (Identity<A>) -> Identity<B> {
133+
func fmap<A, B>(_ f: (A) -> B) -> (Identity<A>) -> Identity<B> {
134134
return { identity in Identity(value: f(identity.value)) }
135135
}
136136

137-
func fmap<A, B>(_ f: A -> B) -> (Const<A, B>) -> Const<A, B> {
137+
func fmap<A, B>(_ f: (A) -> B) -> (Const<A, B>) -> Const<A, B> {
138138
return { const in const }
139139
}
140140

@@ -160,32 +160,32 @@ func runIdentity<A>(_ i: Identity<A>) -> A {
160160
}
161161

162162

163-
func view<S, A>(_ lens: (A -> Const<A, S>) -> S -> ((A -> S) -> Const<A, S> -> Const<A, S>) -> Const<A, S>) -> (S) -> A {
163+
func view<S, A>(_ lens: ((A) -> Const<A, S>) -> (S) -> (((A) -> S) -> (Const<A, S>) -> Const<A, S>) -> Const<A, S>) -> (S) -> A {
164164
return { s in getConst(lens(_Const)(s)(fmap)) }
165165
}
166166

167-
func over<S, A>(_ lens: (A -> Identity<A>) -> S -> ((A -> S) -> Identity<A> -> Identity<S>) -> Identity<S>) -> (A -> A) -> (S) -> S {
167+
func over<S, A>(_ lens: ((A) -> Identity<A>) -> (S) -> (((A) -> S) -> (Identity<A>) -> Identity<S>) -> Identity<S>) -> ((A) -> A) -> (S) -> S {
168168
return { f in { s in runIdentity(lens({ _Identity(f($0)) })(s)(fmap)) } }
169169
}
170170

171-
func set<S, A>(_ lens: (A -> Identity<A>) -> S -> ((A -> S) -> Identity<A> -> Identity<S>) -> Identity<S>) -> (A) -> (S) -> S {
171+
func set<S, A>(_ lens: ((A) -> Identity<A>) -> (S) -> (((A) -> S) -> (Identity<A>) -> Identity<S>) -> Identity<S>) -> (A) -> (S) -> S {
172172
return { x in { y in over(lens)(const(x))(y) } }
173173
}
174174

175-
func _1<A, B, C, D>(_ f: A -> C) -> (A, B) -> ((A -> (A, B)) -> C -> D) -> D {
175+
func _1<A, B, C, D>(_ f: (A) -> C) -> (A, B) -> (((A) -> (A, B)) -> (C) -> D) -> D {
176176
return { (x, y) in { fmap in fmap({ ($0, y) })(f(x)) } }
177177
}
178178

179-
func _2<A, B, C, D>(_ f: B -> C) -> (A, B) -> ((B -> (A, B)) -> C -> D) -> D {
179+
func _2<A, B, C, D>(_ f: (B) -> C) -> (A, B) -> (((B) -> (A, B)) -> (C) -> D) -> D {
180180
return { (x, y) in { fmap in fmap({ (x, $0) })(f(y)) } }
181181
}
182182

183183

184-
public func >>> <T, U, V> (f: T -> U, g: U -> V) -> T -> V {
184+
public func >>> <T, U, V> (f: (T) -> U, g: (U) -> V) -> (T) -> V {
185185
return { g(f($0)) }
186186
}
187187

188-
public func <<< <T, U, V> (f: U -> V, g: T -> U) -> T -> V {
188+
public func <<< <T, U, V> (f: (U) -> V, g: (T) -> U) -> (T) -> V {
189189
return { f(g($0)) }
190190
}
191191

0 commit comments

Comments
 (0)