We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1230006 commit b4c90bdCopy full SHA for b4c90bd
Sources/Overture/Zurry.swift
@@ -6,3 +6,19 @@
6
public func zurry<A>(_ function: @escaping () throws -> A) rethrows -> A {
7
return try function()
8
}
9
+
10
+/// Wraps a value in a function.
11
+///
12
+/// - Parameter value: A value.
13
+/// - Returns: A wrapper function.
14
+public func unzurry<A>(_ value: @autoclosure @escaping () -> A) -> () -> A {
15
+ return value
16
+}
17
18
+/// A throwing variant of `unzurry`.
19
20
21
22
+public func unzurry<A>(_ value: @autoclosure @escaping () throws -> A) -> () throws -> A {
23
24
0 commit comments