Functions
The following functions are available globally.
- 
                  
                  Return the result of evaluating a function fwith argument(s)a.DeclarationSwift public func pipe<A, B>(_ a: A, _ f: (A) -> B) -> BParametersaValue to be passed to f.fFunction to evaluate. Return Valuef(a) 
- 
                  
                  Infix See morepipeoperator.DeclarationSwift public func |><A, B>(a: A, f: (A) -> B) -> BParametersaValue to be passed to f.fFunction to evaluate. Return Valuef(a) 
- 
                  
                  Returns a new function which returns the result of evaluating a function gwith the result of evaluating another functionf.DeclarationSwift public func compose<A, B, C>(_ f: @autoclosure @escaping () -> (A) -> B, _ g: @autoclosure @escaping () -> (B) -> C) -> (A) -> CParametersfFirst function to be called. gSecond function to be called. Return ValueA function which returns the result of calling gwith the output of callingfwith the function’s input:g(f($0)).
- 
                  
                  Infix See morecomposeoperator.DeclarationSwift public func >>><A, B, C>(_ f: @escaping (A) -> B, _ g: @escaping (B) -> C) -> (A) -> CParametersfFirst function to be called. gSecond function to be called. Return ValueA function which returns the result of calling gwith the output of callingfwith the function’s input:g(f($0)).
- 
                  
                  A function which returns its argument. DeclarationSwift public func identity<A>(_ a: A) -> AParametersavalue to return. Return Valuea.
- 
                  
                  A function which ignores its argument. DeclarationSwift public func ignore<A>(_: A) -> VoidParametersavalue to ignore. 
- 
                  
                  Create a curried version of a two-argument function. DeclarationSwift public func curry<A, B, C>(_ f: @autoclosure @escaping () -> (A, B) -> C) -> (A) -> (B) -> CParametersffunction to curry. Return Valuea chain of functions each taking a single argument. 
- 
                  
                  Create a curried version of a three-argument function. DeclarationSwift public func curry<A, B, C, D>(_ f: @autoclosure @escaping () -> (A, B, C) -> D) -> (A) -> (B) -> (C) -> DParametersffunction to curry. Return Valuea chain of functions each taking a single argument. 
- 
                  
                  Create a curried version of a four-argument function. DeclarationSwift public func curry<A, B, C, D, E>(_ f: @autoclosure @escaping () -> (A, B, C, D) -> E) -> (A) -> (B) -> (C) -> (D) -> EParametersffunction to curry. Return Valuea chain of functions each taking a single argument. 
- 
                  
                  Create a function accepting an ignored argument. DeclarationSwift public func uncurry<A, B>(_ f: @autoclosure @escaping () -> () -> B) -> (A) -> BParametersffunction to uncurry. Return ValueA function which ignores its argument, returning f(). 
- 
                  
                  Convert a curried function into one that takes two arguments. DeclarationSwift public func uncurry<A, B, C>(_ f: @autoclosure @escaping () -> (A) -> (B) -> C) -> (A, B) -> CParametersffunction to uncurry. Return ValueA function taking two arguments. 
- 
                  
                  Convert a curried function into one that takes three arguments. DeclarationSwift public func uncurry<A, B, C, D>(_ f: @autoclosure @escaping () -> (A) -> (B) -> (C) -> D) -> (A, B, C) -> DParametersffunction to uncurry. Return ValueA function taking three arguments. 
- 
                  
                  Convert a curried function into one that takes four arguments. DeclarationSwift public func uncurry<A, B, C, D, E>(_ f: @autoclosure @escaping () -> (A) -> (B) -> (C) -> (D) -> E) -> (A, B, C, D) -> EParametersffunction to uncurry. Return ValueA function taking four arguments. 
- 
                  
                  Reverse the order of a two-argument function’s arguments. DeclarationSwift public func reverse<A, B, C>(_ f: @autoclosure @escaping () -> (A, B) -> C) -> (B, A) -> CParametersfa function. Return Valuea function which accepts arguments in the reverse order. 
- 
                  
                  Reverse the order of a three-argument function’s arguments. DeclarationSwift public func reverse<A, B, C, D>(_ f: @autoclosure @escaping () -> (A, B, C) -> D) -> (C, B, A) -> DParametersfa function. Return Valuea function which accepts arguments in the reverse order. 
- 
                  
                  Reverse the order of a four-argument function’s arguments. DeclarationSwift public func reverse<A, B, C, D, E>(_ f: @autoclosure @escaping () -> (A, B, C, D) -> E) -> (D, C, B, A) -> EParametersfa function. Return Valuea function which accepts arguments in the reverse order. 
- 
                  
                  Reverse the order of a two-curry function. DeclarationSwift public func reverse<A, B, C>(_ f: @autoclosure @escaping () -> (A) -> (B) -> C) -> (B) -> (A) -> CParametersfa function. Return Valuea function which accepts curried arguments in the reverse order. 
- 
                  
                  Reverse the order of a three-curry function. DeclarationSwift public func reverse<A, B, C, D>(_ f: @autoclosure @escaping () -> (A) -> (B) -> (C) -> D) -> (C) -> (B) -> (A) -> DParametersfa function. Return Valuea function which accepts curried arguments in the reverse order. 
- 
                  
                  Reverse the order of a four-curry function. DeclarationSwift public func reverse<A, B, C, D, E>(_ f: @autoclosure @escaping () -> (A) -> (B) -> (C) -> (D) -> E) -> (D) -> (C) -> (B) -> (A) -> EParametersfa function. Return Valuea function which accepts curried arguments in the reverse order. 
- 
                  
                  Infix version of See morefcomposed withbind. Returns a function that maps a value through bothfandg.DeclarationReturn Valuethe result of giffandgare both successful, a failure otherwise.
- 
                  
                  Creates a switched function that always returns success. DeclarationSwift public func turnout<A, B, C>(_ f: @autoclosure @escaping () -> (A) -> B) -> (A) -> Result<B, C>Parametersffunction being evaluated. Return Valuea function mapping a value to a result via f.
- 
                  
                  Pipes a value to another function, returning the original value instead. DeclarationSwift public func tee<A, B>(_ f: @autoclosure @escaping () -> (A) -> B) -> (A) -> AParametersffunction to evaluate. Return Valuea function which maps a value to itself, passig it to ffirst.
- 
                  
                  Pipes a value to another function, returning the original value instead. This version may throw. DeclarationSwift public func tee<A, B>(_ f: @autoclosure @escaping () -> (A) throws -> B) -> (A) throws -> AParametersffunction to evaluate. Return Valuea function which maps a value to itself, passig it to ffirst.
- 
                  
                  Create a function that interprets a thrown error as a failed result. DeclarationSwift public func tryCatch<A, B>(_ f: @autoclosure @escaping () -> (A) throws -> B) -> (A) -> Result<B, Error>Parametersffunction evaluated with the passed-in value. Return Valuea function mapping a value to a Result.
- 
                  
                  Evaluate a function returning an optional value, returning a failure if nilwas returned, converting an optional to a two-way track.DeclarationParametersffunction to evaluate. Return Valuea function mapping a value to a Result.
 View on GitHub
View on GitHub Install in Dash
Install in Dash Functions  Reference
        Functions  Reference