Last active
August 29, 2015 14:23
-
-
Save kongtomorrow/77c53e32ecf50b94f3c1 to your computer and use it in GitHub Desktop.
Revisions
-
kongtomorrow revised this gist
Jun 21, 2015 . 1 changed file with 11 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,19 +23,25 @@ func ==(lhs:Foo, rhs:Foo) -> Bool { // or actually, is Smashable supposed to extend Value and always smash other stuff to its own type? If so, maybe this, protocol Value : Equatable { } protocol Smashable { func valueBySmashingOtherValue<SomeOtherValue : Value>(val: SomeOtherValue) -> Self } struct Bar : Value { } func ==(lhs:Bar, rhs:Bar) -> Bool { return false } struct Foo : Value, Smashable { func valueBySmashingOtherValue<SomeOtherValue : Value>(val: SomeOtherValue) -> Foo { return Foo() } } func ==(lhs:Foo, rhs:Foo) -> Bool { return false } -
kongtomorrow revised this gist
Jun 21, 2015 . 1 changed file with 9 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,19 +1,25 @@ protocol Value : Equatable { } protocol Smashable { typealias TargetValue : Value func valueBySmashingOtherValue<SomeOtherValue : Value>(value: SomeOtherValue) -> TargetValue } struct Bar : Value { } func ==(lhs:Bar, rhs:Bar) -> Bool { return false } struct Foo : Value, Smashable { func valueBySmashingOtherValue<SomeOtherValue : Value>(value: SomeOtherValue) -> Bar { return Bar() } } func ==(lhs:Foo, rhs:Foo) -> Bool { return false } // or actually, is Smashable supposed to extend Value and always smash other stuff to its own type? If so, maybe this, -
kongtomorrow revised this gist
Jun 21, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,8 +2,8 @@ protocol Value { } protocol Smashable { typealias TargetValue : Value func valueBySmashingOtherValue(someOtherValue: Value) -> TargetValue } struct Bar : Value { -
kongtomorrow revised this gist
Jun 21, 2015 . 1 changed file with 11 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,14 +3,14 @@ protocol Value { protocol Smashable { typealias V : Value func valueBySmashingOtherValue(someOtherValue: Value) -> V } struct Bar : Value { } struct Foo : Value, Smashable { func valueBySmashingOtherValue(someOtherValue: Value) -> Bar { return Bar() } } @@ -20,13 +20,16 @@ struct Foo : Value, Smashable { protocol Value { } protocol Smashable { typealias V : Value func valueBySmashingOtherValue(someOtherValue: Value) -> V } struct Bar : Value { } struct Foo : Value, Smashable { func valueBySmashingOtherValue(someOtherValue: Value) -> Bar { return Bar() } } -
kongtomorrow revised this gist
Jun 21, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,13 +3,13 @@ protocol Value { protocol Smashable { typealias V : Value func valueBySmashingOtherValue<OtherV : Value>(value: OtherV) -> V } struct Bar : Value { } struct Foo : Value, Smashable { func valueBySmashingOtherValue<OtherV : Value>(value: OtherV) -> Bar { return Bar() } -
kongtomorrow revised this gist
Jun 21, 2015 . 1 changed file with 19 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,14 +3,30 @@ protocol Value { protocol Smashable { typealias V : Value func valueBySmashingOtherValue(value: V) -> V } struct Bar : Value { } struct Foo : Value { func valueBySmashingOtherValue<OtherV : Value>(value: OtherV) -> Bar { return Bar() } } // or actually, is Smashable supposed to extend Value and always smash other stuff to its own type? If so, maybe this, protocol Value { } protocol Smashable : Value { func valueBySmashingOtherValue<AnyOtherValue : Value>(value: AnyOtherValue) -> Self } struct Foo : Smashable { func valueBySmashingOtherValue<AnyOtherValue : Value>(value: AnyOtherValue) -> Foo { return Foo() } } -
kongtomorrow created this gist
Jun 21, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ protocol Value { } protocol Smashable { typealias V : Value func valueBySmashingOtherValue(value: V) -> V } struct Bar : Value { } struct Foo : Value { func valueBySmashingOtherValue<OtherV : Value>(value: OtherV) -> Bar { return Bar() } }