These are chat archives for ramda/ramda

30th
Jul 2015
Jethro Larson
@jethrolarson
Jul 30 2015 00:35
Sure, though the lesson I'm really trying to teach here is dealing with functions of higher arity
Actually, how would you cleanly do this with a lens?
calcAge is Person -> Int
Jethro Larson
@jethrolarson
Jul 30 2015 00:41
if it were person.age = calcAge(person.age) , then that's clearly just R.over(R.lensProp('age'), calcAge, person)
I think if I tried to walk people through the implementation of lenses I'd confuse everyone including the speaker
David Chambers
@davidchambers
Jul 30 2015 00:49
:)
You’re right. If you have calcAge :: Person -> Int it’s probably not a good fit for lenses (though I’m sure it could be done somehow).
Jethro Larson
@jethrolarson
Jul 30 2015 00:57

btw

var composeAll = reduce(flip(compose), identity)

Jethro Larson
@jethrolarson
Jul 30 2015 01:04

It amuses me that

var composeAll = reduce(pipe, identity)

and

var pipeAll = reduce(compose, identity)
Hardy Jones
@joneshf
Jul 30 2015 02:41
@davidchambers well there's a few interpretations of "FRP": there's most of what people talk about, and then there's the right way as Conal defined it. So it's easy to not know what "FRP" actually is.
Scott Sauyet
@CrossEye
Jul 30 2015 02:57
@joneshf: I'm not sure that having been the person to use the term give Conal that much standing to say what it really means. Words and terms grow over time with the community usage. OTOH, in the JS community FRP has really come to mean "What Bacon and RxJS do", which is ... shall we say ... slightly limited.
Hardy Jones
@joneshf
Jul 30 2015 05:50
FRP has an actual definition along with an actual denotation though. It's not just a phrase like functional programming (which most people can't seem to agree on a definition for). So It's not really something that you can call other similar concepts and still have the same denotation, by definition it is not longer FRP.
Simon Friis Vindum
@paldepind
Jul 30 2015 05:54

@joneshf

It's not just a phrase like functional programming (which most people can't seem to agree on a definition for).

Conal actually has a definition for functional programming (or denotational programming as he likes to call it): programming with mathematical functions.

It's quite unfortunate for Conal. He invented a thing, gave it a name and described it with probably the most precise method available (denotational semantics) and still people went of taking his name but not really his ideas.
Simon Friis Vindum
@paldepind
Jul 30 2015 06:01
I was at one point working on a FRP library for JS which is faithful to the classic FRP semantics. It's called hareactive but is on standby right now. The implementation is inspired by Conal's "Push and pull FRP" paper. It's also blazing fast.
The problem is that Conal's main ideas are not trouble free. Using denotational semantics outside of a language like Haskell is tricky (or at least I think so) and continuous time isn't really all that useful in many cases.
Hardy Jones
@joneshf
Jul 30 2015 06:10
oh, I don't think it's a panacea
nothing really has been yet
I was just listening to a guy today go on and on about how eiffel solves the software problem
Martin Algesten
@algesten
Jul 30 2015 07:49

I know you don't like promises, but have you considered something like this for ramda? https://github.com/algesten/fnuc/blob/promise/test.coffee ... a helper function (fut) that makes any function "promise aware" so that when it detects any argument that are thenable, it returns a promise and applies the function when the thenable resolves.

my implementation is a proof of concept and sucks. because it 1) is serial, 2) mutates arrays 3) uses .then of the last promise twice. would happily take pointers on how to make it nicer. https://github.com/algesten/fnuc/blob/promise/src/fnuc.coffee#L175

Scott Christopher
@scott-christopher
Jul 30 2015 09:03
@algesten You can achieve a similar thing with something resembling an applicative instance for Promises: https://gist.github.com/scott-christopher/39d982cac2a29ced5a6a
Martin Algesten
@algesten
Jul 30 2015 09:16
@scott-christopher thanks! that’s neat (and i need to think about that). could it be modified to:
1. not have access to any promise library (.then of one of the incoming promises is enough to continue making promises)
2. guarantee that each incoming promise is that the most .then once?
Scott Christopher
@scott-christopher
Jul 30 2015 09:33
The problem with making it solely rely on .then is that you need a way to get the initial fn into a Promise, e.g. Promise.resolve.
and to the best of my knowledge, the example in the gist should only ever call each promise's then once.
If you didn't mind having the constraint that the user must wrap the initial function in a promise, then you could implement it using only then, but it's not such a nice interface.
Simon Friis Vindum
@paldepind
Jul 30 2015 09:55
@joneshf Eiffel? I didn't think that language was still a thing. How much large scale software had he written in the language?
Stefano Vozza
@svozza
Jul 30 2015 17:19
there's loads of old banking applications still knocking around that were written in eiffel; really good money if you've got the necessary knowledge
Jethro Larson
@jethrolarson
Jul 30 2015 17:50
const isGreaterThan = (a) => (b) => b > a
I think this is better for 100% of the times I've used R.gt
@paldepind FRP is going to go all AJAX, isn't it?
"AJAX animations"
Jethro Larson
@jethrolarson
Jul 30 2015 18:06
Found this
Push Pull FRP talk by Conal https://vimeo.com/6686570
He has a great speaking voice. Almost makes me feel like I'm understanding what he's saying
Martin Algesten
@algesten
Jul 30 2015 18:37
@jethrolarson that's impossible to watch because of the idiot controlling the video.
David Chambers
@davidchambers
Jul 30 2015 20:10
@jethrolarson, do you think we should reverse the order of arguments to R.{g,l}t{,e}? These functions currently don’t respect the least-likely-to-change-to-most-likely-to-change argument order of other Ramda functions.
Jack Firth
@jackfirth
Jul 30 2015 20:44
Hi everyone! Two things: first, thanks for making Ramda, it's fantastic, second, I'm making a Python translation of the library (https://github.com/jackfirth/pyramda)
David Chambers
@davidchambers
Jul 30 2015 21:34
Cool. I know someone who’ll be excited to see a Python port.
Jack Firth
@jackfirth
Jul 30 2015 21:38
The object/dictionary stuff is probably the trickiest, since python doesn't play quite as fast and loose with the distinction as JS does
David Chase
@davidchase
Jul 30 2015 21:45
Here's a question for you guys
http://bit.ly/1KCgojB
returns {"aboutMe": {"measurements": {"dressSize": "25"}}}
is there a nice way to have it return {"aboutMe": {"measurements": {"dressSize": "25", "shirtSize": "-"}}}
since the public profile didnt contain a shirtSize key it should just be left alone
Scott Sauyet
@CrossEye
Jul 30 2015 21:46
@jackfirth: That's very cool to see.
Jack Firth
@jackfirth
Jul 30 2015 21:49
@CrossEye : Thanks. PRs welcome :)
Martin Algesten
@algesten
Jul 30 2015 21:53
@davidchase merge is not recursive, so the entire aboutMe key is replaced. http://bit.ly/1KDuP4b
David Chase
@davidchase
Jul 30 2015 21:54
@algesten yes i understand that, i was just putting up an example... i was wondering if that was possible
the idea is so aboutMe.measurements.shirtSize returns '-' per say rather than just undefined
Kevin Wallace
@kedashoe
Jul 30 2015 22:41
@davidchase I believe deep merge is currently on hiatus ramda/ramda#1181
Scott Christopher
@scott-christopher
Jul 30 2015 22:54
@algesten Regarding the conversation about promises, I realised it is actually possible to create that function without depending on a particular promise implementation.
I’ve updated that gist I posted earlier with an example.
It just requires that the arguments are all promises.
It is possible to create a version that requires only the first argument to be a promise, but that’s probably a strange thing to try explain to those using it.
Jack Firth
@jackfirth
Jul 30 2015 23:10
50+ ramda functions ported to python
David Chase
@davidchase
Jul 30 2015 23:33
@kedashoe thanks for the link, yeah i was just seeing if i was missing anything possibly a different approach