These are chat archives for ramda/ramda

13th
Jun 2015
Raine Virta
@raine
Jun 13 2015 00:12
what lens talk are you referring to? I didn't see one linked
Jethro Larson
@jethrolarson
Jun 13 2015 01:37
Yeah that one was more understandable but he still out ran me a bunch
Raine Virta
@raine
Jun 13 2015 10:37
buzzdecafe, that was a great podcast, thanks for sharing.
Raine Virta
@raine
Jun 13 2015 13:33
has anyone come up with a haskell-esque type notation for JS that also describes the "content" of a value, in addition to the type? or do you just use type synonym style [ProfileAvatarURL] -> [Image] etc.
Simon Friis Vindum
@paldepind
Jun 13 2015 13:36
What do you mean with content?
Raine Virta
@raine
Jun 13 2015 13:38
typically variables describe the content of a value, with point free functions you lose that information
Simon Friis Vindum
@paldepind
Jun 13 2015 13:39
With union-type you can describe the data type in any way you like.
var Amount = Type({Amount: [R.allPass([R.lt(0), R.gt(10)]);
Raine Virta
@raine
Jun 13 2015 13:40
// :: String -> Buffer
getAvatar = pipe(getAvatarURL, http.get)
admittedly, you can improve that by coming up with more elaborate names
// :: String -> Buffer
getAvatarForUser = pipe(getAvatarURL, http.get)
Simon Friis Vindum
@paldepind
Jun 13 2015 13:42
Ahh. Type notatation. I missed that.
Raine Virta
@raine
Jun 13 2015 13:42
but basically my point is that String conveys no information about the nature of the value, apart from the type
Simon Friis Vindum
@paldepind
Jun 13 2015 13:43
What is wrong with type synonyms?
type Username = String
Raine Virta
@raine
Jun 13 2015 13:45
nothing, if you're writing haskell
Simon Friis Vindum
@paldepind
Jun 13 2015 13:49
But these are not code anyway?
// :: Username -> Buffer
getAvatarForUser = pipe(getAvatarURL, http.get)
Hardy Jones
@joneshf
Jun 13 2015 21:54
@raine yeah, that's a problem no matter what language you're using. If you have very specific types, you're golden (since there's only so much you can do with them), or if you have very general types you're golden (because again, you can't do much with them), but it's these in between types like string/int/boolean that make things harder.
well boolean isn't so bad, since there's only two inhabitants
but string and number and things like that are pretty bad to work with in the general.
Tobias Pflug
@gilligan
Jun 13 2015 22:33
hm, so who of you is good with bloody promises ? I have a promise of promises. Does not seem like when.js provides a join function. And the crappy promises stack of course cannot offer something like that on its own anyhow
Raine Virta
@raine
Jun 13 2015 22:36
Promise.all?
Scott Sauyet
@CrossEye
Jun 13 2015 22:36
Yeah , all is much more common, and not much less convenient.
Tobias Pflug
@gilligan
Jun 13 2015 22:39
m(
facepalm
thanks guys
obvious
i was looking for something similar to haskell join the whole time and somehow that made me not see the obvious
Raine Virta
@raine
Jun 13 2015 22:41
i know the feeling
Tobias Pflug
@gilligan
Jun 13 2015 22:43
js programming with ramda is a very double edged sword
i do this silly thing where I add type annotation comments to my functions and things look pretty neat and tidy
Scott Sauyet
@CrossEye
Jun 13 2015 22:44
... then the real world hits... ?
Tobias Pflug
@gilligan
Jun 13 2015 22:45
and then I run some code and js explodes in my face again with some crap
;-)
Raine Virta
@raine
Jun 13 2015 22:45
FP in JS hipsterism
Scott Sauyet
@CrossEye
Jun 13 2015 22:45
If it's Ramda doing that to you, let us know how. We're always looking to improve it.
Tobias Pflug
@gilligan
Jun 13 2015 22:45
no no..rest assured
its just me not being good enough at playing compiler in my head
Scott Sauyet
@CrossEye
Jun 13 2015 22:46
I think I may be alone in fighting a rear-guard action trying to keep this familiar to JS folks that it might not do quite as well for those coming from more sane langs.
Michael Hurley
@buzzdecafe
Jun 13 2015 23:54
more sane languages
that's a pretty big category