-
Notifications
You must be signed in to change notification settings - Fork 233
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
Monoidal instead of Applicative #260
Comments
This is awesome and I would love to see it happen, but alongside our current Applicative. Swift does not support tuple extensions, so any generality we could extract would have to be by writing 7 billion overloads again. Basically, until Tuple stops being an amorphous compiler hack I don't think this would work in quite the way you'd expect |
Yeah, there would probably have to be a What I like about the Instead of |
So, how much boilerplate is enough boilerplate then? |
Which is to say: I definitely agree that that looks more natural, but am I gonna have to maintain 15 more structs in the near future? |
Scala seemed to have made the decision for everyone that |
Then to 22 we shall go! Would you like to draw up a pull request, or shall I? |
I might have time tonight to get something going. Would you want Applicative to be defined in terms of Monoidal, vice versa, or independent of one another? |
Do whatever is most natural (which probably means separate at first). We'll worry about the nitty-gritty in code review. |
I've got TupleOf to TupleOf5 if that helps. Couldn't give up on shrinking in SwiftCheck... |
Unrelated, but have you considered opening a gitter channel for this project? I think I remember a talk where @non mentioned that it contributed Cats growing community but maybe I made that part up. |
I promoted the creation of a slack channel - typelift.slack.com - but it's pretty lonely there at the mo. Will look into gitter. |
What's nice about gitter is that it's discoverable. And you don't need a slack account. |
right. slack is cumbersome for unpaid use. discoverability is precious too. |
Having read through this thread, I've just created https://gitter.im/typelift and invited @CodaFi. Anyone else want in? |
I'd love to give gitter a go. |
Is it not going to be a public channel? |
I guess we can make it public, but I don't know how to do that! |
Isn't it just "Create Room" -> Repository -> Swiftz? |
Maybe? I'm on mobile right now, so it'll have to wait for a few hours. |
Okay, https://gitter.im/typelift/general has just been created, and it's public! |
Hurrah!
|
Btw, regarding the need for the boilerplate curried constructor, in Swift 2 this now works: struct Foo { let a: Int, let b: String }
curry(Foo.init) <^> 1 <*> "hello" Of course you'll end up hitting the "expression too complex" pretty quickly... |
Whatever happened to this proposal? Should I draw up the pull request for this myself? |
The http://github.com/non/cats project has been exploring favoring the just as powerful (Monoidal)[https://wiki.haskell.org/Typeclassopedia#Alternative_formulation] typeclass over Applicative.
Applicative can be cumbersome in languages that don't default to partial function application and I also think it has a more intuitive definition than Applicative since it's symmetrical as well as having much nicer laws (naturality, left and right identity, and associativity).
You can also get apply builders almost for free since map2, map3, map4 just become map on tuple2, tuple3, tuple4.
The text was updated successfully, but these errors were encountered: