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

Xcode 7.2.1 / Swift 2.1 #115

Merged
merged 2 commits into from
Oct 13, 2017
Merged

Xcode 7.2.1 / Swift 2.1 #115

merged 2 commits into from
Oct 13, 2017

Conversation

mdiep
Copy link
Collaborator

@mdiep mdiep commented Oct 12, 2017

This updates the code to Swift 7.2.1 / Swift 2.1—the earliest version of Xcode that seems to run on High Sierra.

This removes https://github.com/robrix/Prelude, https://github.com/robrix/Either, and https://github.com/antitypical/Assertions, but adds https://github.com/antitypical/Result. This makes it easier to upgrade, since the dependencies don't need to be updated. But it's also in line with where I'd like Madness to go.

There's one small casualty of this: the removal of <|> that returns a parser of Either<x, y>. But that can easily be added on top of the other <|> variant.

I'll leave this open for a day in case anyone wants to review these PRs. But if no one does, I'll carry on alone. 👊

@@ -1,5 +1,9 @@
// Copyright (c) 2014 Rob Rix. All rights reserved.

public struct ResultResult<T, Error : ErrorType> {
public typealias t = Result<T, Error>
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, this sucks. But it's necessary for now.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol

Copy link
Owner

@robrix robrix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they’re good Madness Brent

case let .Success(tree, sourcePos):
return .Success(tree, sourcePos)
case let .Failure(right):
return .Failure(Error.withReason("no alternative matched:", sourcePos)(left, right))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Result is much better here, nice 👍

@@ -1,5 +1,9 @@
// Copyright (c) 2014 Rob Rix. All rights reserved.

public struct ResultResult<T, Error : ErrorType> {
public typealias t = Result<T, Error>
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol

@@ -76,12 +72,12 @@ final class AlternationTests: XCTestCase {

// MARK: - Fixtures

private let alternation = %"x" <|> (%"y" --> { _, _, _, _, _ in 1 })
private let alternation = %"x" <|> %"y"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

},
"DVTSourceControlWorkspaceBlueprintIdentifierKey" : "16056085-48A1-4F20-BAB0-335120B8B6C5",
"DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : {
"9A760A1EBAC1979D46EF016B1BE84D98E53C16FF" : "Madness\/Carthage\/Checkouts\/Prelude\/",
"7FCD68358D0D5A67F26F2A5E7B31EB3EF0CB2C00" : "Madness\/",
"840BFB2A2F183FC5B01E0B21BB0D3D8EF3F6803F" : "Madness\/Carthage\/Checkouts\/Assertions\/",
"D5FA66743146831DA2A20C0EAE4583EF424D9041" : "Madness\/Carthage\/Checkouts\/Either\/"
"D5FA66743146831DA2A20C0EAE4583EF424D9041" : "Madness\/Carthage\/Checkouts\/Either\/",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these references be 🔥d now?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it matter?

Does anything matter?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh. This whole file should be ignored. I'll do that.

@robrix
Copy link
Owner

robrix commented Oct 12, 2017

There's one small casualty of this: the removal of <|> that returns a parser of Either<x, y>. But that can easily be added on top of the other <|> variant.

Yeah IMO this was gross anyway 👍

@@ -5,3 +5,4 @@ xcuserdata
*.pbxuser
*.xcuserdatad
*.xccheckout
*.xcscmblueprint
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mdiep mdiep merged commit 04fa496 into master Oct 13, 2017
@mdiep mdiep deleted the swift-2.1 branch October 13, 2017 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants