These are chat archives for ramda/ramda

20th
Apr 2018
Jason Shin
@JasonShin
Apr 20 2018 05:19
Do we have a full TS support yet?
Quick question: what exactly is applicative?
Rodrigo Juarez
@rodrijuarez
Apr 20 2018 09:14
hi! I'm having some problems with ramda with and TS
 compose(all(predicate), defaultTo([]));
that code tells me that it's expecting 0 arguments
but defaultTo already expects the second argument
Brad Compton (he/him)
@Bradcomp
Apr 20 2018 15:10
I 'm not fully versed in Typescript, but my understanding is that TS doesn't have a powerful enough type system to handle all of Ramda's functions. I don't know if compose has a type that TS can represent.
Brandon Chartier
@brandonchartier
Apr 20 2018 15:12
Brad Compton (he/him)
@Bradcomp
Apr 20 2018 15:14

@JasonShin

what exactly is applicative

The short answer is something that follows the Applicative spec. For a better introduction to the topic, I would suggest starting here. It's also covered in the wonderful Mostly Adequate Guidebook

:point_up: haha
Mike Lambert
@lax4mike
Apr 20 2018 15:31
in short, applicatives allow you to use two or more Functors as arguments to a regular function
R.lift(R.add)(Maybe.of(2), Maybe.of(3)) // Maybe(5)
Brandon Chartier
@brandonchartier
Apr 20 2018 15:32
until there's a HM style type checker for JS, I might not be interested in type checking
Daniel Rodríguez Rivero
@danielo515
Apr 20 2018 15:34
HM ?
You mean like haskell ?
Brandon Chartier
@brandonchartier
Apr 20 2018 15:35
yeah, Hindley-Milner
had a hard time loving TS/Flow
Daniel Rodríguez Rivero
@danielo515
Apr 20 2018 15:35
Typescript was actually built for OOP
Brandon Chartier
@brandonchartier
Apr 20 2018 15:35
yeah
Daniel Rodríguez Rivero
@danielo515
Apr 20 2018 15:36
It is to make JAVA and C# guys comfortable with JS
:smile:
Brandon Chartier
@brandonchartier
Apr 20 2018 15:36
lol, very true
Daniel Rodríguez Rivero
@danielo515
Apr 20 2018 15:36
I tried it several times, and I never felt more confident about my code, but just more restricted, fighting with type errors
Specially annoying when the error is caused by a bad library definition, because they are manually built