These are chat archives for ramda/ramda

15th
Apr 2017
Jonah
@jonahx
Apr 15 2017 01:08
Here’s a problem that seems like it could be solved by a 1-2 liner, but I’m struggling to find a solution that isn’t labored. Say you have an array like [0,1,2,0]. You wish to get a list of copies of that array, with each 0 replaced by a 3, but only one replacement made in each copy. That is, the output for that array would be:
[3,1,2,0]
[0,1,2,3]
Jonah
@jonahx
Apr 15 2017 02:13
a reduce isn’t so bad….
;[0,1,2,0].reduce((m,x,i,arr)=>
  (x != 0) ? m : m.concat([update(i,3,arr)])
, [])
awb99
@awb99
Apr 15 2017 07:40
Does anyone of the Ramda users use some kind of type checking system (Flow) or some other kind of pre-compilation?
I personally made the choice to use Ramda, because Javascript is the Browser and in Node.js; and therefore I can always track what is going via Javascript.
However, I find that some of my code only blows up very late,
and this is typically exactly the kind of thing that does not happen in compiled languages, or in languages with type cheks.
Basially I am hoping, that I can run some kind of linters/ type checkers / etc , and then end up with more working code than I have now.
Gabe Johnson
@gabejohnson
Apr 15 2017 11:03
I don't use it, but there are
flow-typed definitions for Ramda. Don't know how well they work
@awb99 :point_up_2:
There's also Sanctuary for optional runtime checks
Raine Virta
@raine
Apr 15 2017 12:38
@ram-bot 1
ram-bot
@ram-bot
Apr 15 2017 12:38
1
Robert Mennell
@skatcat31
Apr 15 2017 23:08
HOLY COW THE RAM IS ALIVE! @ram-bot console.log('Hello!')
... Did I speak too soon?