These are chat archives for ramda/ramda

29th
Oct 2015
Scott Christopher
@scott-christopher
Oct 29 2015 00:00

It might satisfy the theorem, but the pain is that you HAVE to prove it. You don't get it for free.

Yep, that was the gist that I've got so far.

joneshf-work1
@joneshf-work1
Oct 29 2015 00:15
that'd be a cute little tool, ramda optimizer.
Scott Christopher
@scott-christopher
Oct 29 2015 00:15
I was only thinking about something like that yesterday when the topic of ASTs came up.
Like evaporating `identity` where possible.
joneshf-work1
@joneshf-work1
Oct 29 2015 00:16
btw, I started on an implementation of pipes last week, it came out pretty nice.
Scott Christopher
@scott-christopher
Oct 29 2015 00:16
So did I, hahaha
joneshf-work1
@joneshf-work1
Oct 29 2015 00:16
I'll clean it up and throw it up soon
nice
Scott Christopher
@scott-christopher
Oct 29 2015 00:17
Though my approach was a simple, direct translation of it to purescript, mainly as an exercise of getting my head into the purescript space
joneshf-work1
@joneshf-work1
Oct 29 2015 00:19
How far could you get? doesn't it use `UndecidableInstances`?
Scott Christopher
@scott-christopher
Oct 29 2015 00:20
I only got as far as replicating the `Core` and `Internal` modules
Damn, the explicit `forall` syntax gets a bit long in the tooth
e.g.
``````(>+>) :: forall m a a' b b' _c' c c' r. (Monad m)
=> ( b' -> Proxy a' a b' b m r)
-> (_c' -> Proxy b' b c' c m r)
-> (_c' -> Proxy a' a c' c m r)
(>+>) fb' fc' c' = fb' +>> fc' c'``````
joneshf-work1
@joneshf-work1
Oct 29 2015 00:23
I think those are the bulk of it yeah?
well prelude as well, but that's more just churn.
Also, I think lots of those constraints can be weakened.
Scott Christopher
@scott-christopher
Oct 29 2015 00:25
That's where I'm hoping to absorb some of your knowledge :D
I can understand what's going on by following the code, but the intuition hasn't landed yet
joneshf-work1
@joneshf-work1
Oct 29 2015 00:25
Well, most of the things that require `Monad m` should only require `Functor m`.
like the `Functor` instance for `Proxy` shouldn't need a `Monad m`, just `Functor m`.
Scott Christopher
@scott-christopher
Oct 29 2015 00:28
Are they potentially declared as monad constraints because they'll end up as an `Effect`?
I'll just PM you to prevent hijacking ramda's channel :)
joneshf-work1
@joneshf-work1
Oct 29 2015 00:38
hehe, I was about to paste a blob of stuff...
boxofrox
@boxofrox
Oct 29 2015 02:03
This message was deleted

whoa. not what I wanted to do.
it's not javascript or ramda, but I really enjoyed the introduction and application of lamda calculus to create a recursive function... hopefully this doesn't explode again.

okay, gitter... you win this time
oh, isn't that special. I have to opt-out of the automatic video embedding with the collapse option from the comment menu.
Tobias Pflug
@gilligan
Oct 29 2015 07:29
@sinelaw not really.. let/const/arrow-functions/destructuring/imports/.. all the good stuff
Raine Virta
@raine
Oct 29 2015 08:09
:point_up: October 28, 2015 10:49 PM thoughts?
Martin Algesten
@algesten
Oct 29 2015 08:39
not ramda related. but this is sweet. we run microservices and have a ton of them using a global nodejs (0.12). i'm dreading upgrading the node-install. using this we can probably package up self contained services that have the correct node version bundled with them
https://github.com/h2non/nar
Raine Virta
@raine
Oct 29 2015 08:42
@algesten lol, I was searching for that module really hard like a month ago, never found it
Martin Algesten
@algesten
Oct 29 2015 08:43
@raine i just tried this with some of our simpler services. and it seems to work great. next up i try building a linux-bundle on my mac and run in prod.
Raine Virta
@raine
Oct 29 2015 08:44
we use docker
Martin Algesten
@algesten
Oct 29 2015 08:44
i want to use docker. we set things up before docker was big/around. so it's chef all the way. but i want it.
@iamstarkov
Oct 29 2015 09:01
@xgrommx do I need `R.nthArg` to rewrite you variant to use it in a `R.pipe`?
Denis Stoyanov
@xgrommx
Oct 29 2015 09:20
@iamstarkov what kinds of variants do u mean?
@iamstarkov
Oct 29 2015 09:33
@xgrommx `obj2arr = R.zipWith(R.objOf, R.keys(o), R.values(o))`
@xgrommx i can do it like `obj2arr = o => R.zipWith(R.objOf, R.keys(o), R.values(o))`
Denis Stoyanov
@xgrommx
Oct 29 2015 09:36
@iamstarkov This example doesn't need provide object to each function `R.converge(R.zipWith(R.objOf), [R.keys, R.values])(o)`
@iamstarkov
Oct 29 2015 09:36
but maybe i can somehow query `o`
ok, thank you
Viktor Fröberg
@vikfroberg
Oct 29 2015 12:03
Unrealated to Ramda but do any of you guys know what the “loose: all” option on babelify means? https://github.com/zenorocha/clipboard.js/pull/50/files#diff-b9cfc7f2cdf78a7f4b91a753d10865a2R10
Raine Virta
@raine
Oct 29 2015 12:06
Viktor Fröberg
@vikfroberg
Oct 29 2015 12:08
@raine I was looking through the docs for babelify and not babel, thanks!
Scott Sauyet
@CrossEye
Oct 29 2015 12:14
@raine: obviously such would be useful for stricter type-checking. I don't have a particular need for it, but I wouldn't object.
Raine Virta
@raine
Oct 29 2015 13:10
also, :point_up: October 28, 2015 9:25 AM
Scott Sauyet
@CrossEye
Oct 29 2015 14:40
@raine: definitely `Lens`.
Raine Virta
@raine
Oct 29 2015 14:42
why so?
darkseas
@darkseas
Oct 29 2015 14:48
Greetings all. I've been on the round trip Ramda -> lodash-fp -> lodash -> Ramda and see the version bump to 0.18. Are there any change notes about to summarise the updates? I last used 0.17.1, I think, so maybe not too much has changed?
Raine Virta
@raine
Oct 29 2015 14:48
ramda/ramda#1436 <- @darkseas
darkseas
@darkseas
Oct 29 2015 14:49
Thanks for that.
Raine Virta
@raine
Oct 29 2015 15:14
@CrossEye is there a way to check if a value is a Lens?
Should `R.type` return `"Lens"` for values that are lenses?
Tobias Pflug
@gilligan
Oct 29 2015 16:49
that would happen automagically if `lens` had toString return `"Lens"`
not sure that would be desirable
Raine Virta
@raine
Oct 29 2015 17:37
trying to find a way to get this to work
Tobias Pflug
@gilligan
Oct 29 2015 17:43
@raine ugh.. unless some explicit information is provided by what `R.lens` returns that will make it uniquely identifiable that should be rather hard to accomplish
since a lens is just a function
@raine you could use `toString` .. cough ..
Raine Virta
@raine
Oct 29 2015 17:48
how would that help?
`['@@functional/lens'] = true` crossed my mind but not sure about that
Tobias Pflug
@gilligan
Oct 29 2015 17:49
well if some `l` is a lens created by `R.lens` then l.toString() will equal `"'function (f) {\n return function (s) {\n return map(function (v) {\n return setter(v, s);\n }, f(getter(s)));\n };\n }'"`
not saying it's a good idea :)
Raine Virta
@raine
Oct 29 2015 17:49
are there side effects in piggybacking properties in functions?
Tobias Pflug
@gilligan
Oct 29 2015 17:52
you mean just tag whatever R.lens returns with some property ?
Raine Virta
@raine
Oct 29 2015 17:53
yep
Tobias Pflug
@gilligan
Oct 29 2015 17:55
seems to work from what i can tell
Raine Virta
@raine
Oct 29 2015 17:55
`ramda-t` has control of the return values so it doesn't have to be part of ramda
Tobias Pflug
@gilligan
Oct 29 2015 17:56
in that case tagging everything with some `__type` property is maybe not such a bad idea
David Chambers
@davidchambers
Oct 29 2015 17:58
If we're tagging, I suggest `'@@type'` as the property name for compatibility with plaid/sanctuary#105.
Tobias Pflug
@gilligan
Oct 29 2015 18:00
ah, alright ;-)
David Chambers
@davidchambers
Oct 29 2015 18:00
The value could be `'ramda/Lens'`.
Tobias Pflug
@gilligan
Oct 29 2015 18:03
@davidchambers ramda/ramda#1453 <-- 1. iojs 1.5.1 failed to install in travis - should I trigger a re-run with a forced push or smth ? 2. any other comments or would you be okay with merging that ?
David Chambers
@davidchambers
Oct 29 2015 18:04
I restarted the build. Let's see what happens this time.
Tobias Pflug
@gilligan
Oct 29 2015 18:04
;-)
.oO( god I hope we will switch to travis at work soon ... )
David Chambers
@davidchambers
Oct 29 2015 18:04
What are you using?
Tobias Pflug
@gilligan
Oct 29 2015 18:05
we are stuck with jenkins
it's so insanely crappy
everything breaks all the time and the jenkins UI is pretty much "back the 90s" style
and configs spread across jenkins instances etc etc
we'll hopefully switch to travis or circleci sometime soon
Raine Virta
@raine
Oct 29 2015 18:10
We use Jenkins too
Regrettably
David Chambers
@davidchambers
Oct 29 2015 18:12
@gilligan, the tests passed that time. :)
Scott Sauyet
@CrossEye
Oct 29 2015 19:16
I think perhaps I was wrong. The sig for, say, `view` might have to be function. Although we have helpers to make it easier to create `Lens`es Nothing should require you to use them.
joneshf-work1
@joneshf-work1
Oct 29 2015 19:19
`Lens` is a type synonym though.
I think the synonym provides much more detail about what to do.
@raine that's exceptionally cool
Tobias Pflug
@gilligan
Oct 29 2015 19:24
@davidchambers @CrossEye any general objections to `lensPath` ? Started writing a PR for that
David Chambers
@davidchambers
Oct 29 2015 20:04
I think I'm in favour of the idea. My one hesitation is that it might obscure the fact that lenses compose as do "normal" functions.
Tobias Pflug
@gilligan
Oct 29 2015 20:06
as long as you don't think it'd totally suck I can just do the PR and see where the discussion leads. It's not all that much work or challenging anyway
David Chambers
@davidchambers
Oct 29 2015 20:31
Sounds good!
Martin Algesten
@algesten
Oct 29 2015 23:54
@raine if er are tagging, i suggest using `Object.defineProperty` to make the prop non-enumerable. Less "leakage".