Skip to content

Commit

Permalink
Add Additive conformance to Array (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsbean authored Sep 6, 2018
1 parent 88fbb7d commit c48ab68
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Sources/Algebra/AlgebraAdapters.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ extension Sequence where Element: Additive {
}
}

extension Array: Additive {

// MARK: - Additive

/// - Returns: An `Array` with no elements.
public static var zero: Array {
return Array()
}
}

extension Set: Additive {

// MARK: - Additive
Expand Down

0 comments on commit c48ab68

Please sign in to comment.