Functions
The following functions are available globally.
-
Just like Swift.precondition, but includes the full file path in the diagnostic.
Declaration
Swift
func precondition( _ condition: @autoclosure () -> Bool, _ message: @autoclosure () -> String = String(), file: StaticString = #filePath, line: UInt = #line ) -
Just like Swift.preconditionFailure, but includes the full file path in the diagnostic.
Declaration
Swift
func preconditionFailure( _ message: @autoclosure () -> String = String(), file: StaticString = #filePath, line: UInt = #line ) -> Never -
Just like Swift.fatalError, but includes the full file path in the diagnostic.
Declaration
Swift
func fatalError( _ message: @autoclosure () -> String = String(), file: StaticString = #filePath, line: UInt = #line ) -> Never -
Just like Swift.assert, but includes the full file path in the diagnostic.
Declaration
Swift
func assert( _ condition: @autoclosure () -> Bool, _ message: @autoclosure () -> String = String(), file: StaticString = #filePath, line: UInt = #line ) -
Just like Swift.assertionFailure, but includes the full file path in the diagnostic.
Declaration
Swift
func assertionFailure( _ message: @autoclosure () -> String = String(), file: StaticString = #filePath, line: UInt = #line ) -
Returns the result of calling
actionwith an immutable projection ofvalue.Declaration
Swift
public func read<T, U>(_ value: T, _ action: (T) throws -> U) rethrows -> U -
Returns the result of calling
actionwith a mutable projection ofvalue.Declaration
Swift
public func modify<T, U>(_ value: inout T, _ action: (inout T) throws -> U) rethrows -> U -
Assigns
valueto the result of applyingtransformon it.Declaration
Swift
public func update<T>(_ value: inout T, with transform: (T) throws -> T) rethrows -
Marks this execution path as unreachable, causing a fatal error otherwise.
Declaration
Swift
public func unreachable( _ message: @autoclosure () -> String = "", file: StaticString = #filePath, line: UInt = #line ) -> Never -
Returns
lhs!iflhsis non-nil; evaluatesrhs(), which never returns, otherwise.Declaration
Swift
public func ?? <T>(lhs: T?, rhs: @autoclosure () -> Never) -> T
View on GitHub
Functions Reference