These are chat archives for ramda/ramda

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

@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
2
James Forbes
@JAForbes
Oct 31 2016 05:50
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
Thank you :)
Keith Alexander
@kwijibo
Oct 31 2016 12:10
Was there a particular edition @joneshf recommended? Or am I thinking of another book?
Denis Stoyanov
@xgrommx
Oct 31 2016 12:17
@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
@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
@JAForbes From everything I hear, the Haskell Book is pretty amazing.
Keith Alexander
@kwijibo
Oct 31 2016 16:15
thanks @joneshf
Dalibor Novak
@BorePlusPlus
Oct 31 2016 19:02
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
That seems to have worked: https://goo.gl/7PbOCP
Travis LaDuke
@laduke
Oct 31 2016 20:19
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
Perhaps using zipWith?
Travis LaDuke
@laduke
Oct 31 2016 20:24
I sense a lift, but those are too tricky
Scott Santucci
@ScottFreeCode
Oct 31 2016 20:27
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
@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
Unexpected token [
Brad Compton (he/him)
@Bradcomp
Oct 31 2016 20:28
ugh, ram-bot isn't ES6 apparently
Brad Compton (he/him)
@Bradcomp
Oct 31 2016 20:28
Travis LaDuke
@laduke
Oct 31 2016 20:29
that does it
Now reading transpose docs.
Scott Santucci
@ScottFreeCode
Oct 31 2016 20:31
:+1:
Denis Stoyanov
@xgrommx
Oct 31 2016 21:14
transpose = getZipList . traverse ZipList
This message was deleted
ram-bot
@ram-bot
Oct 31 2016 21:14
console is not defined
Denis Stoyanov
@xgrommx
Oct 31 2016 21:58
This message was deleted
ram-bot
@ram-bot
Oct 31 2016 21:58
Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
Denis Stoyanov
@xgrommx
Oct 31 2016 21:59
This message was deleted
ram-bot
@ram-bot
Oct 31 2016 21:59
Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
Brad Compton (he/him)
@Bradcomp
Oct 31 2016 21:59
@xgrommx Just link to the REPL maybe?
Travis LaDuke
@laduke
Oct 31 2016 22:33
no round/ceil/floor in ramda?
Denis Stoyanov
@xgrommx
Oct 31 2016 22:37

@laduke

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

:smile:

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