Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Feb 01 2021 10:11
    @SystemFw banned @Hudsone_gitlab
  • Jan 31 2019 04:19
    404- forked
    404-/fs2
  • Jan 31 2019 03:01
    SethTisue commented #1232
  • Jan 30 2019 17:22
  • Jan 30 2019 13:45
  • Jan 30 2019 10:48
    pchlupacek commented #1406
  • Jan 30 2019 10:47
    pchlupacek commented #1406
  • Jan 30 2019 10:39
    pchlupacek commented #1407
  • Jan 30 2019 09:58
    lJoublanc commented #870
  • Jan 30 2019 09:42
    vladimir-popov commented #1407
  • Jan 30 2019 08:10
    vladimir-popov closed #1407
  • Jan 30 2019 08:10
    vladimir-popov commented #1407
  • Jan 29 2019 19:20
    SystemFw commented #1407
  • Jan 29 2019 19:20
    SystemFw commented #1407
  • Jan 29 2019 18:57
    SystemFw commented #1406
  • Jan 29 2019 17:47
    pchlupacek commented #1406
  • Jan 29 2019 17:42
    pchlupacek commented #1406
  • Jan 29 2019 17:39
    pchlupacek commented #1407
  • Jan 29 2019 17:39
    vladimir-popov edited #1407
  • Jan 29 2019 17:38
    vladimir-popov commented #1406
Billzabob
@Billzabob
Am I missunderstanding or isn’t that the opposite of the whole “Constraints liberate, liberties constrain” thing? I thought you’re supposed to try and keep things specific and in the “unexploded” form for as long as you can.
Christopher Davenport
@ChristopherDavenport
Thats waht he said.
Constrain yourself more.
F[A] is strictly less powerful than Stream[F, A]
Billzabob
@Billzabob
So you would want to keep it as Stream[F, A] as long as possible and only .compile as late as possible then right? Ok, I guess I was just missunderstanding what the > meant is that list.
Christopher Davenport
@ChristopherDavenport
If you are in Stream, then you don't drop down.
But if you are F[A] dont needlessly escalate to Stream[F, A]
Adam Rosien
@arosien
"do this more" > "do this less" in that description
Bob Glamm
@glammr1
^^ one of the earliest lessons I learned by trying Scala FP is exactly that
"why am I using A => F[B] here when a simple F[B] would do"
Adam Rosien
@arosien
if you apply that literally, you get tagless-final style :)
Billzabob
@Billzabob
@ChristopherDavenport Ah ok that makes sense :) Thanks
Bob Glamm
@glammr1
@arosien yes, it was on that path of discovery
Christopher Davenport
@ChristopherDavenport
Then it all becomes kleisli.
Adam Rosien
@arosien
i'm still getting there...
Bob Glamm
@glammr1
You know Kleisli pops up a lot more than I would have expected when I write FP
Adam Rosien
@arosien
a SUPER example is scala-steward, the ENTIRE app is just tagless-final traits + mixing them all together at the top layer: https://github.com/fthomas/scala-steward/tree/master/modules/core/src/main/scala/org/scalasteward/core
oh and any of @ChristopherDavenport's libraries too
he basically takes an idea for a library, writes out the algebra, writes an impl or 2, then is done
:jazz-hands:
Christopher Davenport
@ChristopherDavenport
Thats the idea, that and minimizing allocations for the small wins in FP.
Adam Rosien
@arosien
but scala-steward is a great example of the tagless-final discipline in a big-ish app
Bob Glamm
@glammr1
That's Liskov's process for writing applications
"I think of a language that enables me to solve the problem at hand then write the interpreter for the language"
Adam Rosien
@arosien
yeah, we're all just catching up :)
Christopher Davenport
@ChristopherDavenport
^^ This is final tagless
A laguage where it all just writes like butter.
In the french style of cooking.
Bob Glamm
@glammr1
I've seen glimmerings of that in my exploration
"wow, this code reads how I would write it up in my software design docs and requirements"
Adam Rosien
@arosien
but there's also the step of integrating that language into the main program, so it pays to have a very composable return type, like F
Christopher Davenport
@ChristopherDavenport
As @arosien states, that app is a great example.
Adam Rosien
@arosien
i randomly wondered how he implemented that bot, and was totally surprised!
Bob Glamm
@glammr1
How much benefit is there to going all the way to data constructors & free algebras for implementation? I seem to recall that some of the libraries use that instead of direct final tagless impls
Christopher Davenport
@ChristopherDavenport
Don't go free in scala unless you have a real use case why you should at the moment.
Most libraries using free are exploring rewriting in tagless.
Adam Rosien
@arosien
you can go tagless-final => free with an interpreter :)
reify
Bob Glamm
@glammr1
Would it be fair to say "it's worth learning but I'm unlikely to have code that justifies the usage of free"?
Christopher Davenport
@ChristopherDavenport
Also you don't have to reinvent the entire wheel up to whatever you need.
Like Rob had to basically subsume a good chunk of cats-effect to make ConnectionIO work.
Adam Rosien
@arosien
it's an implementation of separating program from implementation, so in that sense it is important and useful. tagless final is a cheaper encoding, for some dimensions of cost
Fabio Labella
@SystemFw
@glammr1 is worth learning the general concept behind both free and final tagless because they are both more general than free or final tagless
Adam Rosien
@arosien
caller chooses the effect constraint in tagless-final (F has to be a Monad, etc.), vs. the caller acts on Free
Fabio Labella
@SystemFw
for example, implementing new complex types is better done with initial encodings (free-like)
case in point: Stream and IO
whereas application abstraction in terms of commands/interfaces is nicer in final tagless
Adam Rosien
@arosien
method of tagless final algebra =~ data type representing that method coupled with Free
Bob Glamm
@glammr1
I seem to have this vague recollection that recursion schemes & free algebras are closely related and that's the piece I'm really curious about
Fabio Labella
@SystemFw
yeah, you need Fix to start talking about cata