Last active
April 14, 2022 09:24
-
-
Save Viveron/fae0b985392d85fb71787a7e6d0ca076 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public typealias Closure<Value, Result> = (Value) -> Result | |
public typealias ValueClosure<Value> = Closure<Value, Void> | |
public typealias ResultClosure<Result> = () -> Result | |
public typealias VoidClosure = ResultClosure<Void> | |
public typealias ThrowsClosure<Value, Result> = (Value) throws -> Result | |
public typealias ThrowsValueClosure<Value> = ThrowsClosure<Value, Void> | |
public typealias ThrowsResultClosure<Result> = () throws -> Result | |
public typealias ThrowsVoidClosure = ThrowsResultClosure<Void> | |
// OR | |
typealias Closure<Input, Output> = (Input) -> Output | |
typealias ValueClosure<Input> = Closure<Input, Void> | |
typealias ResultClosure<Output> = () -> Output | |
typealias VoidClosure = ResultClosure<Void> | |
typealias ThrowsClosure<Input, Output> = (Input) throws -> Output | |
typealias ThrowsValueClosure<Input> = ThrowsClosure<Input, Void> | |
typealias ThrowsResultClosure<Output> = () throws -> Output | |
typealias ThrowsVoidClosure = ThrowsResultClosure<Void> | |
// OR | |
typealias Closure<Input, Output> = (Input) -> Output | |
typealias InputClosure = Closure<Input, Void> | |
typealias OutputClosure = () -> Output | |
typealias VoidClosure = OutputClosure<Void> | |
typealias ThrowsClosure<Input, Output> = (Input) throws -> Output | |
typealias ThrowsInputClosure = ThrowsClosure<Input, Void> | |
typealias ThrowsOutputClosure = () throws -> Output | |
typealias ThrowsVoidClosure = ThrowsOutputClosure<Void> |
Author
Viveron
commented
Apr 14, 2022
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment