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 action with an immutable projection of value.

    Declaration

    Swift

    public func read<T, U>(_ value: T, _ action: (T) throws -> U) rethrows -> U
  • Returns the result of calling action with a mutable projection of value.

    Declaration

    Swift

    public func modify<T, U>(_ value: inout T, _ action: (inout T) throws -> U) rethrows -> U
  • Assigns value to the result of applying transform on 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! if lhs is non-nil; evaluates rhs(), which never returns, otherwise.

    Declaration

    Swift

    public func ?? <T>(lhs: T?, rhs: @autoclosure () -> Never) -> T