Comments (4)
Ha, we actually made concat
a lil more "swifty" in order to support trailing closures.
concat(buttonStyle) {
$0.backgroundColor = .red
}
// vs.
concat(buttonStyle, and: {
$0.backgroundColor = .red
})
This is a bit of a cheat code, but it works with concat
as it scales to its variadic number of arguments.
concat(a, b, c, d, e, f, and: g)
The pipe
and chain
functions also are overloaded to create larger pipelines. I'm not sure what to do about scaling them, though:
pipe(a, into: b, then: c, before: d, andThen: e)
I'm also not sure if these kinds of labels are readable together. E.g., using with
makes the meaning less clear:
with(x, pipe(incr, into: square))
I think in general the goal of these functions is to reduce visual noise and focus on the pipeline and composition. It should also be easy to manipulate existing pipelines and plug a new function into them anywhere, which is a flexibility that seems at odds with adding argument labels.
pipe(a, b, c, d, e)
We're up to discuss ideas that address these problems, though!
from swift-overture.
I'm using it just to say that's a huge achievement and work, I'm reading it and impress, do you had a Medium article about it?
That's a game change for Swift. I'm pretty sure that work will have recognition in the future when people would be aware of these workings.
By the way, if you allow me I want to contribute creating more test cases for improving your code coverage tests.
Thank you!
from swift-overture.
Heh, you got me confused. I am also not sure what is the best API after all ;-)
from swift-overture.
Going to close this for now. Thanks for the discussion! Feel free to make suggestions for any other specific API changes by opening a new issue
from swift-overture.
Related Issues (17)
- zip(with:) are not public ? HOT 1
- iOS target for Carthage HOT 5
- Ambiguous use of `with` HOT 2
- Redefine `set` without `over` HOT 1
- Add Info.plist HOT 1
- Currying higher order functions obscures type. HOT 2
- Compile times of with, concat & mut functions in swift4 are very high!! HOT 2
- Add zip to Result HOT 1
- getting EXC_BAD_ACCESS while calling overture methods in static vars HOT 3
- Adding the operators counterpart HOT 5
- `with` is different from how it's portrayed in readme HOT 3
- Compilation failure using mut on a navigation controller HOT 1
- Is there a better way to style UINavigation's bar appearance?
- Add @discardableResult to update() HOT 4
- Potentially add `rethrows` to `over` and similar functions
- Throwing overloads HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swift-overture.