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

PropertyType changes #2841

Closed
andersio opened this issue Apr 29, 2016 · 1 comment
Closed

PropertyType changes #2841

andersio opened this issue Apr 29, 2016 · 1 comment
Labels
Milestone

Comments

@andersio
Copy link
Member

andersio commented Apr 29, 2016

Just saw a few proposals for RAC 5.0, so I decided to bring this one up again. :)

If RAC 5.0 is targeting Swift 3.0 and API compatibility is not a concern, PropertyType and MutablePropertyType could use a few changes (that were rejected before due to breaking changes & impl. issue):

  1. Introduce PropertyType.withValue(_:) and MutablePropertyType.modify(_:).
  2. Move the MutableProperty swap(:_) to MutablePropertyType.
  3. Make value a default implementation of the protocols, depending on (1).

These require SE-0049: Move @noescape and @autoclosure to be type attributes to be implemented cleanly.

With these additions, new compositing/transforming operators like map(_:) can be introduced using PropertyType.signal gracefully, but need not worry about breaking conforming types with a thread safe guarantee, e.g. MutableProperty (#2788 (comment)).

@mdiep mdiep added this to the 5.0 milestone Apr 30, 2016
@andersio
Copy link
Member Author

andersio commented May 18, 2016

Just played with the latest Swift 3 snapshot. I found that fully realising this proposal would need Swift 3 to have not only @noescape but rethrows allowed in function type annotations. Otherwise, compromises would have to be made until Swift has constrainable existentials, e.g. no rethrows on protocols, or using type erased wrappers in the impl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants