These are chat archives for ramda/ramda

25th
Mar 2015
David Chambers
@davidchambers
Mar 25 2015 00:12
What do people think of the idea of removing R.forEach and suggesting that people use R.map with a "void" function for side effects? Do we like having R.forEach because it yells "SIDE EFFECTS HERE!"?
Hardy Jones
@joneshf
Mar 25 2015 00:23
@buzzdecafe @toastal if you had map and ap on the Function protoype you could do:
var splitter = R.ap(R.map(R.split, R.prop('slug')), R.prop('link'));
var s = {link: 'a.b.c', slug: '.'};
splitter(s); //=> [ 'a', 'b', 'c' ]
Hardy Jones
@joneshf
Mar 25 2015 00:34
@davidchambers I think it's good to have both. Even though there's no type checker catching mistakes, you get a sort of visual clue where dragons might be.
Michael Hurley
@buzzdecafe
Mar 25 2015 00:50
i think using map for side effects is much worse than using forEach
Matt Murphy
@mmmurf
Mar 25 2015 01:09
hello, anyone know if prop can use dot notation to dig deeper into nested props? or some other way of doing this?
I guess just composing two prop calls might do it
yep that appears to work :) amazing how asking a question often is enough to trigger the insight
Matt Murphy
@mmmurf
Mar 25 2015 01:17
@davidchambers yes forEach is confusing bc it appears to have side effects, but only if side effects are generally discouraged by Ramda
Michael Hurley
@buzzdecafe
Mar 25 2015 01:28
forEach is for side effects.
we return the input list from forEach -- so you can still compose with it
Walle Cyril
@GrosSacASac
Mar 25 2015 11:50
I like using for each to change the DOM
Scott Sauyet
@CrossEye
Mar 25 2015 12:18
@mmmurf also see path
Thomas Crevoisier
@ThomasCrevoisier
Mar 25 2015 12:35
Hello ! I'm starting to use Ramda seriously on my project (yeaaaah \o/) and I'm getting familiar with the API. I was wondering : what's the difference between "partial" and currying ?
Raine Virta
@raine
Mar 25 2015 12:52
partial application is when you "partially apply" a function (already curried or with partial()) to arguments so that a new function is returned that may or may not be expecting more arguments
if you partially apply a curried function curry(f)(1) it will return a new function as long as the complete list of arguments of f is not satisfied
if you partially apply a function with partial(f, 1) it will always return a new function, even if f is excepting a single argument
Thomas Crevoisier
@ThomasCrevoisier
Mar 25 2015 13:05
Okay I see, thanks !
Raine Virta
@raine
Mar 25 2015 20:07
@joneshf would you recommend purescript for someone who knows a bit of haskell but without much practical experience, I've basically gone through LYAH
my concern is that I'll confuse myself because the languages are quite similar but not completely, and PS is strictly evaluated
Ludwig Magnusson
@TheLudd
Mar 25 2015 20:37
Is the commutefunction in ramda also known as traverse in other libs or is traverse something else?
Michael Hurley
@buzzdecafe
Mar 25 2015 20:38
not quite the same, but pretty similar
Ludwig Magnusson
@TheLudd
Mar 25 2015 20:45
what is the difference then? =)
Michael Hurley
@buzzdecafe
Mar 25 2015 20:45
gonna make me go back and look, eh?
:grimacing:
Ludwig Magnusson
@TheLudd
Mar 25 2015 20:46
Only if it is no trouble for you :)
Michael Hurley
@buzzdecafe
Mar 25 2015 20:47
ramda/ramda#441
not too bad
Ludwig Magnusson
@TheLudd
Mar 25 2015 20:49
oh, thanks
didn't know it had been discussed in ramda
Hardy Jones
@joneshf
Mar 25 2015 21:40
@raine I'd say you'll have a much easier time with ps if you know more haskell than not.
You certainly can pick it up, but the documentation is still very much a work in progress.
And the compiler errors are attrocious, so you lose quite a bit of help from the compiler vs haskell
Raine Virta
@raine
Mar 25 2015 21:41
oh and I thought haskell errors were atrocious
Hardy Jones
@joneshf
Mar 25 2015 21:41
it's still worlds better than going free fall into js of course
heh, ghc has really descriptive error messages
and more importantly the message given is usually not far from the point of failure
Ludwig Magnusson
@TheLudd
Mar 25 2015 22:10
@paldepind Out of the blue: Do you work with react/flux stuff?