These are chat archives for ramda/ramda

31st
Oct 2016
Jigar Gosar
@jigargosar
Oct 31 2016 05:15 UTC
@davidchambers done, what's the agenda?
Jigar Gosar
@jigargosar
Oct 31 2016 05:32 UTC

@davidchambers I would like to run a similar pool for clamp.
My hypothesis being it's more useful with max-exclusive. for e.g.

const clamp2 = curry((min, maxExclusive)=>clamp(min, maxExclusive-1))

const arr = [1,2,3]
const clampIdx = clamp2(0, arr.length)

clampIdx(-1) // 0
clampIdx(9) // 2

@ram-bot

ram-bot
@ram-bot
Oct 31 2016 05:34 UTC
2
James Forbes
@JAForbes
Oct 31 2016 05:50 UTC
hey @joneshf I remember listening to an interview on a podcast, I'm not sure which one. You recommended a book for learning Haskell (I think), you said you preferred it to Learn You A Good Haskell. Apologies if I've got my wires crossed. What was the book called?
It was Functional Geekery.
James Forbes
@JAForbes
Oct 31 2016 06:12 UTC
Thank you :)
Keith Alexander
@kwijibo
Oct 31 2016 12:10 UTC
Was there a particular edition @joneshf recommended? Or am I thinking of another book?
Denis Stoyanov
@xgrommx
Oct 31 2016 12:17 UTC
@kwijibo for js this book is awesome as for me https://www.manning.com/books/functional-programming-in-javascript
Hardy Jones
@joneshf
Oct 31 2016 14:23 UTC
@kwijibo I read the second edition, but I hear the third edition is even better.
@kwijibo has some stuff on html and svgs if i remember right
Brad Compton (he/him)
@Bradcomp
Oct 31 2016 15:49 UTC
@JAForbes From everything I hear, the Haskell Book is pretty amazing.
Keith Alexander
@kwijibo
Oct 31 2016 16:15 UTC
thanks @joneshf
Dalibor Novak
@BorePlusPlus
Oct 31 2016 19:02 UTC
Hopefully a quick question. Is there a way to get a lens that works on nested object that contains arrays? Such that it actually preserves arrays.
I am trying to do something like this https://goo.gl/QwNb94
but array called 'foo' gets converted to an object
Should I compose lenses?
Dalibor Novak
@BorePlusPlus
Oct 31 2016 19:10 UTC
That seems to have worked: https://goo.gl/7PbOCP
Travis LaDuke
@laduke
Oct 31 2016 20:19 UTC
I have 4 arrays I want to turn into an array of objects, like zipObj but with more values... hrm
Scott Santucci
@ScottFreeCode
Oct 31 2016 20:24 UTC
Perhaps using zipWith?
Travis LaDuke
@laduke
Oct 31 2016 20:24 UTC
I sense a lift, but those are too tricky
Scott Santucci
@ScottFreeCode
Oct 31 2016 20:27 UTC
Got a small example of the input and output you want that I could look at?
Brad Compton (he/him)
@Bradcomp
Oct 31 2016 20:27 UTC
@ram-bot
const as = [1, 2, 3, 4];
const bs = ['a', 'b', 'c', 'd']
const cs = [5, 6, 7, 8]
const ds = ['e', 'f', 'g', 'h']

reduce((acc, [a, b, c, d]) => R.append({a, b, c, d}, acc), [], transpose([as, bs, cs, ds]))
ram-bot
@ram-bot
Oct 31 2016 20:27 UTC
Unexpected token [
Brad Compton (he/him)
@Bradcomp
Oct 31 2016 20:28 UTC
ugh, ram-bot isn't ES6 apparently
Brad Compton (he/him)
@Bradcomp
Oct 31 2016 20:28 UTC
Travis LaDuke
@laduke
Oct 31 2016 20:29 UTC
that does it
Now reading transpose docs.
Scott Santucci
@ScottFreeCode
Oct 31 2016 20:31 UTC
:+1:
Denis Stoyanov
@xgrommx
Oct 31 2016 21:14 UTC
transpose = getZipList . traverse ZipList
This message was deleted
ram-bot
@ram-bot
Oct 31 2016 21:14 UTC
console is not defined
Denis Stoyanov
@xgrommx
Oct 31 2016 21:58 UTC
This message was deleted
ram-bot
@ram-bot
Oct 31 2016 21:58 UTC
Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
Denis Stoyanov
@xgrommx
Oct 31 2016 21:59 UTC
This message was deleted
ram-bot
@ram-bot
Oct 31 2016 21:59 UTC
Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
Brad Compton (he/him)
@Bradcomp
Oct 31 2016 21:59 UTC
@xgrommx Just link to the REPL maybe?
Travis LaDuke
@laduke
Oct 31 2016 22:33 UTC
no round/ceil/floor in ramda?
Denis Stoyanov
@xgrommx
Oct 31 2016 22:37 UTC

@laduke

const ceil = n => Math.ceil(n);
const floor = n => Math.floor(n);

:smile:

Travis LaDuke
@laduke
Oct 31 2016 23:51 UTC
Just making sure there wasn't some strange math word for it I never heard before. ;)