These are chat archives for ramda/ramda

8th
Feb 2019
Nicolás Fantone
@nfantone
Feb 08 01:29
hey, has anyone stumbled upon this in latest release? I have some functions using converge that were working fine until recently
// This stopped working : it now returns a function
// capitalize('word')  -> [Function]
const capitalize = converge(concat, [compose(toUpper, head), compose(toLower, tail)])
I don't get what's going on... if I don't pass in functions with compose as arguments, it goes back to working fine
so things like converge(concat, [toUpper, toLower]) or converge(concat, [head, tail]) do what they are supposed to
but as soon as I wrap any of them in compose, converge returns a Function
Nicolás Fantone
@nfantone
Feb 08 01:36
> converge(concat, [toUpper, compose(toLower)])('word')
[Function]
> converge(concat, [toUpper, compose(toLower)])('word', 'foo')
'WORDword'
Nicolás Fantone
@nfantone
Feb 08 01:41
found the problem - but not the cause... I think this is a bug
> compose(toLower).length
2
> toLower.length
1
that doesn't look right to me
Nicolás Fantone
@nfantone
Feb 08 01:47
I can confirm that rolling back to ramda@0.26.0 makes this go away
and:
❯ node
> const { compose, toLower } = require('ramda');
> toLower.length
1
> compose(toLower).length
1