Skip to content

A project to demonstrate how breaking up an expression into distinct sub-expressions causes a build error.

License

Notifications You must be signed in to change notification settings

paulyoung/CurryingIssue

Repository files navigation

Currying Issue

A project to demonstrate how breaking up an expression into distinct sub-expressions causes a build error.

extension Foo: Decodable {
    public static func decode(json: JSON) -> Decoded<Foo> {
        let createdAt = Decoded.Success(NSDate())
        let updatedAt = Decoded.Success(NSDate())

-        return curry(self.init)
+        let f = curry(self.init)
            <^> createdAt
+        return f
            <*> updatedAt
    }
}

Cannot convert value of type 'Decoded<(NSDate?) -> Foo>' (aka 'Decoded<Optional<NSDate> -> Foo>') to expected argument type 'Decoded<_ -> _>'

Originally reported in thoughtbot/Argo#193 (comment).

Usage

Install dependencies with git submodule update --init --recursive and then open the .xcworkspace and attempt to build the target.

About

A project to demonstrate how breaking up an expression into distinct sub-expressions causes a build error.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published