Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Sep 14 18:08
    @SethTisue banned @discjock:matrix.org
  • Sep 12 20:37
    @SethTisue banned @manuelzamoratetherbtcusa:matrix.org
  • Sep 06 14:29
    @SethTisue banned @white_hat_hacker:minds.com
  • Sep 06 14:29
    @SethTisue banned @alexchole:matrix.org
  • Aug 31 17:03
    @SethTisue banned @andersonwatts7:matrix.org
  • 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
Ghost
@ghost~5c2a2354d73408ce4fb3431e
or do you mean mtl in the strictest sense of being the mtl library... not "mtl style"
Fabio Labella
@SystemFw
yes, the mtl library
anything that goes beyond that is basically trying to solve final tagless problems
Ghost
@ghost~5c2a2354d73408ce4fb3431e
right, well sure... I consider "mtl style" to be more general. there are a few extensions to the base lib.
Fabio Labella
@SystemFw

I consider "mtl style" to be more general.

yeah, so I think we agree that "this thing" needs a name cause there are different things to talk about ;)

Ghost
@ghost~5c2a2354d73408ce4fb3431e
one thing Haskell is missing is a decent FFunctor library and TH generator
it's not a terrible about of work to write an FFunctor for an algebra, but it'd be nice to have something like @autoFunctorK
Fabio Labella
@SystemFw
this is also another interesting article about a final tagless encoding for effects which disagrees with MTL https://www.tweag.io/posts/2018-10-04-capability.html
Ghost
@ghost~5c2a2354d73408ce4fb3431e
I was going to write this for scalaz (it would have saved about 10 pages of boilerplate in my book!) but I didn't have the time. Good to see that the wider community also picked up on this.
oh, capability. Yeah I seen that. I'm not a fan of that lib. I'm very conservative when it comes to these things.
DerivingVia is a nice way for the "use typeclasses" crowd to continue using their encoding, but I find it to be like reasoning about implicit search and I really just prefer explicit passing of things.
Fabio Labella
@SystemFw

@mdedetrich actually Haskeller were dealing with a problem that required final tagless, but it was a specific one, and then we found out about the broader benefits of the approach. Btw this problem is why Martin is (incorrectly, imho) still skeptical about final tagless: lifting monad transformers automatically. It's akin to thinking that the Web is useless because you have no need to create documents with links to share scientific articles at CERN: basically a fallacy that the reason something was created it's also the reason it still exists/is useful.

The same fallacy happens with IO and laziness.

Ghost
@ghost~5c2a2354d73408ce4fb3431e
I played with an encoding using ReaderT and a type level set to hold the algebras, but I found the mental overhead to be much higher than the boilerplate problem it was solving. I've learn to just accept a little bit of boilerplate in exchange for the explicit nature of the code.
Fabio Labella
@SystemFw
yeah, I'm not saying that these libs are necessarily better. Just that there is more to the technique that it meets the eye and "I don't see why this even deserves a name" it's pretty shortsighted if you actually delve a bit into it.
Ghost
@ghost~5c2a2354d73408ce4fb3431e
(and in the same line of thought, I am creating an Emacs plugin to convert import lists into explicit lists so I never have to guess where anything comes from)
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
cool, thanks
Ghost
@ghost~5c2a2354d73408ce4fb3431e
so basically the kind of the A[_[_]] vs H[_] is the core thing here
Dale Wijnand
@dwijnand
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