These are chat archives for ramda/ramda

13th
Oct 2017
Stefano Vozza
@svozza
Oct 13 2017 06:56
R.map
Stefano Vozza
@svozza
Oct 13 2017 06:57
@Yord ^^^ you don't @ rambot if you just want the type sig
Philipp Wille
@Yord
Oct 13 2017 07:17
@svozza Awesome, thanks!
Stefano Vozza
@svozza
Oct 13 2017 07:44
np
Philipp Wille
@Yord
Oct 13 2017 08:53
R.test @Yord
David Sancho
@davesnx
Oct 13 2017 10:39
Hey guys, how would be the best way of finding a object inside a list inside a list inside a list
and get the path of all of those?
(does it make sense the explaination)?
I thought, try traverse
but the only way that I make it work, is flatten everything :satisfied:
Ashish Gupta
@gotoashishgupta
Oct 13 2017 11:15

Can anyone help

const o1 = {year: 100};
  const x1 = o1;
  const y1 = 90;
  const ltey = R.lte(y1, R.prop('year', x1));
  const aTx = aT(x1);
  const aFx = aF(x1);
console.log('-----', ltey, aTx, aFx)
  const r = R.ifElse(
    ltey,
    aTx,
    aFx
  );
  //return r;
//};
console.log(r);

giving error _arity must be non-negative

what am I doing wrong here

error here is "First argument to _arity must be a non-negative integer no greater than ten"

https://goo.gl/b8gch8

Kurt Milam
@kurtmilam
Oct 13 2017 11:27
R.ifElse
Kurt Milam
@kurtmilam
Oct 13 2017 11:28
@gotoashishgupta the first three arguments to ifElse should be functions.
@gotoashishgupta https://goo.gl/wbDCZM
Ashish Gupta
@gotoashishgupta
Oct 13 2017 13:04
thanks @kurtmilam
Jethro Larson
@jethrolarson
Oct 13 2017 18:49
R.o
Jethro Larson
@jethrolarson
Oct 13 2017 18:49
R.map
Jethro Larson
@jethrolarson
Oct 13 2017 18:49
@rambot is function a functor?
R.map isn't redundant with R.compose but they intersect a lot
Jethro Larson
@jethrolarson
Oct 13 2017 19:11
actually if we swap the arrow to prefix it seems like they're the same...
R.o ∷ (-> b c) → (→ a b) → ( -> a c)
R.map ∷ (-> b c) → (→ a b) → ( -> a c)
in R.map for function the -> a is the Functor
Rick Medina
@rickmed
Oct 13 2017 19:14
@jethrolarson I thought you were asking rambot ;) . I wouldn't say a lot at all. All functions are functors but many functors are not functions
Jethro Larson
@jethrolarson
Oct 13 2017 19:15

R.o is redundant with map, right?

I'm actually answering this question

Rick Medina
@rickmed
Oct 13 2017 19:19
Yeah. Maybe . exists for the ubiquity of the operation? Legacy?
Jethro Larson
@jethrolarson
Oct 13 2017 19:21
Composition is a core thing in category theory. I think it's it's just that map is composition for functors, and functions are functors
Rick Medina
@rickmed
Oct 13 2017 19:23
that's what I wrote, but you're asking why R.o (or ".") exists if I can compose functions with fmap?
Jethro Larson
@jethrolarson
Oct 13 2017 19:23
yeah
I guess in a dynamically typed language you'd rather throw than do the wrong thing, but that's a reason map shouldn't work on functions
Robert Mennell
@skatcat31
Oct 13 2017 21:55
Functor instanceof Function != Function instanceof Functor