Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jul 19 20:37
    @SethTisue banned @tonyobanon
  • Jan 02 23:58
    @SethTisue banned @fakubishes:nerdsin.space
  • Dec 15 2021 05:01
    som-snytt commented #12516
  • Dec 15 2021 04:38
    SethTisue edited #1312
  • Dec 15 2021 04:38
    SethTisue opened #2273
  • Dec 15 2021 04:31
    jackkoenig opened #12516
  • Dec 15 2021 04:29
    SethTisue edited #1312
  • Dec 15 2021 04:28
    SethTisue edited #1312
  • Dec 15 2021 04:27
    SethTisue labeled #9831
  • Dec 15 2021 04:27
    scala-jenkins milestoned #9831
  • Dec 15 2021 04:27
    SethTisue labeled #9831
  • Dec 15 2021 04:27
    SethTisue opened #9831
  • Dec 15 2021 03:35
    som-snytt commented #11339
  • Dec 15 2021 03:27
    som-snytt labeled #12494
  • Dec 15 2021 03:07
    SethTisue edited #1312
  • Dec 15 2021 03:07
    SethTisue edited #1312
  • Dec 15 2021 03:05
    SethTisue edited #1312
  • Dec 15 2021 03:05
    SethTisue edited #1312
  • Dec 15 2021 03:05
    SethTisue edited #1312
  • Dec 15 2021 02:58
    SethTisue edited #1312
Fabio Labella
@SystemFw
ah, I would like that plugin :)
Ghost
@ghost~5c2a2354d73408ce4fb3431e
you'll have to find it :wink:
Dale Wijnand
@dwijnand
btw @fommil was HFunctor what you were looking for, last week?
Ghost
@ghost~5c2a2354d73408ce4fb3431e
I am referring to Scala when I talk abotu "final tagless" not needing a name. I don't think it adds anything to the normal everyday usecases... but the abstraction maybe makes sense to the small group of people who are pushing the boundary. Make sense?
@dwijnand no! HFunctor has the wrong shape, I was aftfer FFunctor
and it doesn't have an official package, it's just been reinvented several times over. Named as "functor over functors"
it cats it is called FunctorK
Dale Wijnand
@dwijnand
how are HFunctor and FFunctor different?
Ghost
@ghost~5c2a2354d73408ce4fb3431e
you're going to make me translate this to Scaal, aren't you? :laughing:
Dale Wijnand
@dwijnand
well that's one way
but I'll take any way
Ghost
@ghost~5c2a2354d73408ce4fb3431e
trait FFunctor[A[_[_]]] {
  def ffmap[F[_], G[_]](af: A[F])(fk: F ~> G): A[G]
}
you know what ~> is?
Dale Wijnand
@dwijnand
yep
Ghost
@ghost~5c2a2354d73408ce4fb3431e
it's a natural transformation, so it's like F[a] => G[a]
Dale Wijnand
@dwijnand
no that's just FunctorK
Ghost
@ghost~5c2a2354d73408ce4fb3431e
whereas HFunctor is more like
Dale Wijnand
@dwijnand
This message was deleted
Matthew de Detrich
@mdedetrich
@SystemFw I actually am more with Martin on this one, I think that Monad Transformers are a terrible abstraction so I can see why he is skeptical
Ghost
@ghost~5c2a2354d73408ce4fb3431e
(I'm trying to translate https://hackage.haskell.org/package/fused-effects-0.1.2.1/docs/Control-Effect-Carrier.html#t:HFunctor )
Ghost
@ghost~5c2a2354d73408ce4fb3431e
trait HFunctor[H[_]] {
  def fmap_[M[_], A, B](f: A => B)(hma: H[M[A]]): H[M[B]]
}
maybe
Dale Wijnand
@dwijnand
alright, I get the gist
Ghost
@ghost~5c2a2354d73408ce4fb3431e
so basically the kind of the A[_[_]] vs H[_] is the core thing here
Dale Wijnand
@dwijnand
cool, thanks
mmhmm
Ghost
@ghost~5c2a2354d73408ce4fb3431e
because you can't cretae a HFunctor for some algebra like @SystemFw's MyDbAlg
it will have shape A[_[_]], e.g.
trait MyDbAlg[F[_]] { ... do stuff ...}
Fabio Labella
@SystemFw

I actually am more with Martin on this one, I think that Monad Transformers are a terrible abstraction so I can see why he is skeptical

@mdedetrich Thats' not what I meant: I meant that even though mtl style was born to solve a problem with transformers, it's very useful regardless, just like even though the Web was created to solve the problem of sharing scientific articles at CERN, it's now very useful regardless

Ghost
@ghost~5c2a2354d73408ce4fb3431e
HFunctor would be useful if you have like a List[Option[Foo]] and you want to map Foo to Bar
Fabio Labella
@SystemFw
@fommil I don't think what you have above is HFunctor as commonly known
Ghost
@ghost~5c2a2354d73408ce4fb3431e
@SystemFw I just grabbed whatever came up first on Hoogle
what's the conventional one? All I know is that all the ones I found had the wrong kind
Fabio Labella
@SystemFw
mapK is the defining operation
mapT :: (Monad m, Monad n) => (forall a. m a -> n a) -> t m b -> t n b this is from the MFunctor lib (naming on this wildly varies)
like, the constraints might change
but taking a natural transformation as the mapping function is the key idea
Ghost
@ghost~5c2a2354d73408ce4fb3431e
I also looked into MFunctor, it's also a different kindedness
Fabio Labella
@SystemFw
t m b -> t n b
Ghost
@ghost~5c2a2354d73408ce4fb3431e
It is over (* -> *) -> * -> * if I recall
whereas FFunctor (or FunctorK in cats) is (* -> *) -> *
Matthew de Detrich
@mdedetrich
@SystemFw Sure thing, but then I would argue its overkill if you aren't solving that specific problem. You should use the simplest abstraction to solve your problem.
Fabio Labella
@SystemFw
@fommil ah, I see what you mean, that seems indeed to be Compose (Nested in cats) with a different kind, sorry

@mdedetrich agree to disagree :)

The benefit to complexity ratio of final tagless is excellent imho. But to each their own, no big deal

Ghost
@ghost~5c2a2354d73408ce4fb3431e
@SystemFw oh, don't get me wrong, I think "final tagless" in Scala is the best way to build FP apps... nothing comes close. I just don't think the name is a benefit to the cause. To me it's "just" using higher kinded types.
Fabio Labella
@SystemFw
@fommil actually I take it back, the hmap operation has the same shape I linked mapK. But yeah you have the kind problem
Ghost
@ghost~5c2a2354d73408ce4fb3431e
yeah, I lost a few hours on that ...
Fabio Labella
@SystemFw
@fommil well, when yesterday I told my colleague "write this BigQuery dsl in final tagless instead, and when [business thing] happens we will be able to easily extend", no higher kinds were involved, and the name brought value :)