Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
CrossEye
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
15 ms
·
31.
▲
by
CrossEye
12y ago
The other side of this, though, is that you're now coupling your tests to the implementation of your solution and not the interface you want to present. You can't simply refactor your code to improve it; you will also have to fin
32.
▲
by
CrossEye
12y ago
I'm not really a C# person, but from what I know of the language, although it has some lambdas and some other functional features especially around LINQ, functional programming really is against the grain of the language, and would not
33.
▲
by
CrossEye
12y ago
A nice example. Thank you. I just want to note that in Ramda, because of it's strong insistence on a data-last API (which makes the currying easier), this would be written in this order: result = filter(greater(R), map(distance(
34.
▲
by
CrossEye
12y ago
I finally got a chance to watch that video, and it looks as though what you're worried about is `flip`. Ramda for one already includes a version that works much like Haskell's. I don't know if this satisfies your objection,
35.
▲
by
CrossEye
12y ago
Just to note, the copy wasn't meant to deal with mutability but to note a changed interface. The items that are emitted have only a subset of the properties of those ingested. We could as easily have added some new properties to them
36.
▲
by
CrossEye
12y ago
I think languages that have named parameters have very different sorts of techniques for these things. I don't know if they're more powerful or not, but they take a very different approach, and offer different design choices.
37.
▲
by
CrossEye
12y ago
It is harder to debug points-free code. I find myself doing more debugging with `log` statements in a long pipeline than I do with other styles of code. On the other side, I tend to work with a few well-tested functions over and over and e
38.
▲
by
CrossEye
12y ago
You can if you want: var jp = function(last) { return formatNames2('John', 'Paul', last); }; var je = function(last) { return formatNames2('James', 'Earl', last); };
39.
▲
by
CrossEye
12y ago
Yeah, I probably shouldn't have cribbed the example from my old "Intro to Functional Programming" talk...
40.
▲
by
CrossEye
12y ago
I don't think currying can reasonably be combined with optional parameters. At least I've never seen a useful way to do so. In a previous article ( http://fr.umio.us/why-ramda/ ) I discuss more thoroughly how
41.
▲
by
CrossEye
12y ago
I've done that too, then had to wave my hands about why I choose that parameter order, when I know damn well the languages isn't going to change... "But just in case...." :-)
42.
▲
by
CrossEye
12y ago
Yes, at first glance, that's pretty close. (You'd have to do something about `.getTime()`, as the original just did lexicographic sorting on date strings.) The article really didn't get into the fact that these blocks of cod
43.
▲
by
CrossEye
12y ago
Have to thank/blame @buzzdecafe for that!
44.
▲
by
CrossEye
12y ago
Yes, freely admitted. (Author here.) I feel that although the distinction can be very important, it's much less so for Javascript. And the implementation in Ramda can be used that way any time you choose: var total = reduce(add
45.
▲
How currying leads to elegant, readable code
(fr.umio.us)
127 points
by
CrossEye
12y ago
|
70 comments
46.
▲
by
CrossEye
12y ago
As a developer of Ramda, I can tell you that this will probably be a long wait! That's not the sort of library this is. It's not trying to be a Javascript answer to Django; Javascript already has Angular, Backbone, Knockout, Emb
47.
▲
Why Ramda?
(fr.umio.us)
5 points
by
CrossEye
12y ago
|
2 comments
48.
▲
by
CrossEye
12y ago
As the co-author of Ramda, I'm excited to finally see this thing getting out there. Next up, algebraic data types?
49.
▲
by
CrossEye
13y ago
I think there is a serious problem in vocabulary. Wikipedia's definition of class ([1]) is quite reasonable, which, slightly paraphrased, reads, "A class is an extensible template for creating objects, providing initial values fo