Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Jakub Kozłowski
@kubukoz
depends on what behavior you expect in cases like Map("2" -> 3) |-| Map("2" -> 5)
with what I suggested it'll be Map("2" -> -2), but you might want to get an empty map
same for Map("2" -> 3) |-| Map("2" -> 1) - that could also be an empty map, if you want to remove the keys and not the values...
if you want to remove iva's keys that are present in isr's keys, you can do iva -- isr.keySet
if you want to just subtract the values under the same key, I'd go with the mapValues thing from a few messages ago
elyphas
@elyphas
@LukaJCB , ok, thank you
@kubukoz ; thank you
Luka Jacobowitz
@LukaJCB
Sure
Jakub Kozłowski
@kubukoz
np
Luka Jacobowitz
@LukaJCB
Hey friends, you should check this out and chime in :) lampepfl/dotty#4712
Jakub Kozłowski
@kubukoz
[X]([Y] => Y => X)
is this Const? 🤔
Luka Jacobowitz
@LukaJCB
Depends on what syntax that is refering to, but it looks like it a bit yeah :D
Jakub Kozłowski
@kubukoz
it's from that issue :P a type lambda I think
Luka Jacobowitz
@LukaJCB
So forall Y. Y => ?, not quite const I guess
Jakub Kozłowski
@kubukoz
I meant like the whole type - that's basically def const[X, Y](x: X)(y: Y): X's types
plus the currying of types
Luka Jacobowitz
@LukaJCB
You might be right :P I’m too tired right now
I’ve been looking at RWS e l s a for a couple of hours :D
Jakub Kozłowski
@kubukoz
hell yeah RWS
Adelbert Chang
@adelbertc
what, no T ?
Luka Jacobowitz
@LukaJCB
There’s a T there, but then you get m e l s a, which really isn’t as nice as elsa 🤷🏽‍♂️
Right now I’m trying to implement an Eq instance for RWST, which is kinda alright I guess
And of course right as I type this I realize there’s already one hidden in the cats test suite 🤦🏻‍♂️
Luka Jacobowitz
@LukaJCB
@adelbertc did you ever use the haskell layers package?
Man monad transformers are just one giant rabit hole that you’ll never actually get out of :smile: Why did the math gods not make them composable? :(
Adelbert Chang
@adelbertc
@LukaJCB nope, i just mtl my way through things
also i didnt know about that package until just now :)
Fabio Labella
@SystemFw
That's where cats mtl roughly comes from
Luka Jacobowitz
@LukaJCB
I’m a bit worried that the layers and monad-classes packages both seem pretty much abandoned in haskell land at this point
Fabio Labella
@SystemFw
well, the thing is that in Haskell mtl is pretty much the only game in town for final tagless given how ubiquitous it is
Ben Fradet
@BenFradet
I think I remember a mechanism to make string interpolation rely on show e.g. s"ab$c" would be equivalent to s"ab${c.show}"
does anyone know how or if I'm misremembering stuff?
Fabio Labella
@SystemFw
@BenFradet I think it's just show"things"
Luka Jacobowitz
@LukaJCB
show"ab$c"?
Too slow
Ben Fradet
@BenFradet
indeed thanks
Luka Jacobowitz
@LukaJCB
@SystemFw you think the reason it hasn't catched on is only to due to the ubiquitousness of mtl?
Fabio Labella
@SystemFw

you think the reason it hasn't catched on is only to due to the ubiquitousness of mtl

Well, I don't know for sure, but I'm sure that the weight of mtl is huuuge

removing MonadTrans in haskell is unthinkable
at least for the time being
Luka Jacobowitz
@LukaJCB
Yeah, that's true
In any case, I think we should do more to hide the various Layer type classes from cats-mtl users, probably said this before, but people have been asking me, and when I start explaining mtl and that they don't need to know about them, they usually realize mtl is fairly simple as a concept
Luka Jacobowitz
@LukaJCB
And by hiding them, I mean just adding more and better documentation 😁
Fabio Labella
@SystemFw
I agree
they should also not be in the top package actually
but in a lifting package
so instances hierarchy implicits syntax and lifting
leaving just the effect classes themselves at the top
Luka Jacobowitz
@LukaJCB
Yes agreed
Soren
@srnb_gitlab
I'm unable to call .traverse on a Vector[Json] using cats and circe. Extremely new to this style of programming and these libraries so I don't know what I'm doing wrong