Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-derive Derivable Conformances #7

Merged
merged 3 commits into from
Dec 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2
jobs:
build:
macos:
xcode: "10.0.0"
xcode: "10.1.0"

steps:
- checkout
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM norionomura/swift:42
FROM swift:4.2

WORKDIR /package

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ test-ios:
set -o pipefail && \
xcodebuild test \
-scheme NonEmpty-Package \
-destination platform="iOS Simulator,name=iPhone XR,OS=12.0" \
-destination platform="iOS Simulator,name=iPhone XR,OS=12.1" \
| xcpretty

test-swift:
Expand Down
12 changes: 0 additions & 12 deletions NonEmpty.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,13 @@
/* Begin PBXBuildFile section */
80CD741220D58CD4004E5F60 /* NonEmpty+RangeReplaceableCollection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80CD740820D58CD3004E5F60 /* NonEmpty+RangeReplaceableCollection.swift */; };
80CD741320D58CD4004E5F60 /* NonEmpty+String.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80CD740920D58CD3004E5F60 /* NonEmpty+String.swift */; };
80CD741420D58CD4004E5F60 /* NonEmpty+Codable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80CD740A20D58CD3004E5F60 /* NonEmpty+Codable.swift */; };
80CD741520D58CD4004E5F60 /* NonEmpty+MutableCollection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80CD740B20D58CD3004E5F60 /* NonEmpty+MutableCollection.swift */; };
80CD741620D58CD4004E5F60 /* NonEmpty+Dictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80CD740C20D58CD3004E5F60 /* NonEmpty+Dictionary.swift */; };
80CD741720D58CD4004E5F60 /* NonEmpty+SetAlgebra.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80CD740D20D58CD3004E5F60 /* NonEmpty+SetAlgebra.swift */; };
80CD741820D58CD4004E5F60 /* NonEmpty+Collection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80CD740E20D58CD3004E5F60 /* NonEmpty+Collection.swift */; };
80CD741920D58CD4004E5F60 /* NonEmpty+RandomAccessCollection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80CD740F20D58CD4004E5F60 /* NonEmpty+RandomAccessCollection.swift */; };
80CD741A20D58CD4004E5F60 /* NonEmpty+BidirectionalCollection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80CD741020D58CD4004E5F60 /* NonEmpty+BidirectionalCollection.swift */; };
80CD741B20D58CD4004E5F60 /* NonEmpty.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80CD741120D58CD4004E5F60 /* NonEmpty.swift */; };
80CD741D20D58CE8004E5F60 /* NonEmpty+Equatable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80CD741C20D58CE8004E5F60 /* NonEmpty+Equatable.swift */; };
80CD741F20D58D14004E5F60 /* NonEmpty+Hashable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80CD741E20D58D14004E5F60 /* NonEmpty+Hashable.swift */; };
80CD742120D58DF0004E5F60 /* NonEmpty+Comparable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80CD742020D58DF0004E5F60 /* NonEmpty+Comparable.swift */; };
80CD742320D58E11004E5F60 /* NonEmpty+Array.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80CD742220D58E11004E5F60 /* NonEmpty+Array.swift */; };
80EFFA6120D5A1BE00B265AE /* NonEmpty+Random.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80EFFA6020D5A1BE00B265AE /* NonEmpty+Random.swift */; };
Expand Down Expand Up @@ -61,16 +58,13 @@
/* Begin PBXFileReference section */
80CD740820D58CD3004E5F60 /* NonEmpty+RangeReplaceableCollection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NonEmpty+RangeReplaceableCollection.swift"; sourceTree = "<group>"; };
80CD740920D58CD3004E5F60 /* NonEmpty+String.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NonEmpty+String.swift"; sourceTree = "<group>"; };
80CD740A20D58CD3004E5F60 /* NonEmpty+Codable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NonEmpty+Codable.swift"; sourceTree = "<group>"; };
80CD740B20D58CD3004E5F60 /* NonEmpty+MutableCollection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NonEmpty+MutableCollection.swift"; sourceTree = "<group>"; };
80CD740C20D58CD3004E5F60 /* NonEmpty+Dictionary.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NonEmpty+Dictionary.swift"; sourceTree = "<group>"; };
80CD740D20D58CD3004E5F60 /* NonEmpty+SetAlgebra.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NonEmpty+SetAlgebra.swift"; sourceTree = "<group>"; };
80CD740E20D58CD3004E5F60 /* NonEmpty+Collection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NonEmpty+Collection.swift"; sourceTree = "<group>"; };
80CD740F20D58CD4004E5F60 /* NonEmpty+RandomAccessCollection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NonEmpty+RandomAccessCollection.swift"; sourceTree = "<group>"; };
80CD741020D58CD4004E5F60 /* NonEmpty+BidirectionalCollection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NonEmpty+BidirectionalCollection.swift"; sourceTree = "<group>"; };
80CD741120D58CD4004E5F60 /* NonEmpty.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NonEmpty.swift; sourceTree = "<group>"; };
80CD741C20D58CE8004E5F60 /* NonEmpty+Equatable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NonEmpty+Equatable.swift"; sourceTree = "<group>"; };
80CD741E20D58D14004E5F60 /* NonEmpty+Hashable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NonEmpty+Hashable.swift"; sourceTree = "<group>"; };
80CD742020D58DF0004E5F60 /* NonEmpty+Comparable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NonEmpty+Comparable.swift"; sourceTree = "<group>"; };
80CD742220D58E11004E5F60 /* NonEmpty+Array.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NonEmpty+Array.swift"; sourceTree = "<group>"; };
80EFFA6020D5A1BE00B265AE /* NonEmpty+Random.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NonEmpty+Random.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -107,12 +101,9 @@
80CD741120D58CD4004E5F60 /* NonEmpty.swift */,
80CD742220D58E11004E5F60 /* NonEmpty+Array.swift */,
80CD741020D58CD4004E5F60 /* NonEmpty+BidirectionalCollection.swift */,
80CD740A20D58CD3004E5F60 /* NonEmpty+Codable.swift */,
80CD740E20D58CD3004E5F60 /* NonEmpty+Collection.swift */,
80CD742020D58DF0004E5F60 /* NonEmpty+Comparable.swift */,
80CD740C20D58CD3004E5F60 /* NonEmpty+Dictionary.swift */,
80CD741C20D58CE8004E5F60 /* NonEmpty+Equatable.swift */,
80CD741E20D58D14004E5F60 /* NonEmpty+Hashable.swift */,
80CD740B20D58CD3004E5F60 /* NonEmpty+MutableCollection.swift */,
80EFFA6020D5A1BE00B265AE /* NonEmpty+Random.swift */,
80CD740F20D58CD4004E5F60 /* NonEmpty+RandomAccessCollection.swift */,
Expand Down Expand Up @@ -269,8 +260,6 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 0;
files = (
80CD741D20D58CE8004E5F60 /* NonEmpty+Equatable.swift in Sources */,
80CD741420D58CD4004E5F60 /* NonEmpty+Codable.swift in Sources */,
80CD741220D58CD4004E5F60 /* NonEmpty+RangeReplaceableCollection.swift in Sources */,
80CD741B20D58CD4004E5F60 /* NonEmpty.swift in Sources */,
80CD741720D58CD4004E5F60 /* NonEmpty+SetAlgebra.swift in Sources */,
Expand All @@ -283,7 +272,6 @@
80CD741520D58CD4004E5F60 /* NonEmpty+MutableCollection.swift in Sources */,
80CD742120D58DF0004E5F60 /* NonEmpty+Comparable.swift in Sources */,
80CD741620D58CD4004E5F60 /* NonEmpty+Dictionary.swift in Sources */,
80CD741F20D58D14004E5F60 /* NonEmpty+Hashable.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
20 changes: 0 additions & 20 deletions Sources/NonEmpty/NonEmpty+Codable.swift

This file was deleted.

5 changes: 0 additions & 5 deletions Sources/NonEmpty/NonEmpty+Equatable.swift

This file was deleted.

12 changes: 0 additions & 12 deletions Sources/NonEmpty/NonEmpty+Hashable.swift

This file was deleted.

8 changes: 8 additions & 0 deletions Sources/NonEmpty/NonEmpty.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,11 @@ extension NonEmpty: CustomStringConvertible {
return "\(self.head)\(self.tail)"
}
}

extension NonEmpty: Equatable where C: Equatable, C.Element: Equatable {}

extension NonEmpty: Hashable where C: Hashable, C.Element: Hashable {}

extension NonEmpty: Decodable where C: Decodable, C.Element: Decodable {}

extension NonEmpty: Encodable where C: Encodable, C.Element: Encodable {}