Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Rob Norris
@tpolecat
Squeeee I can't wait!
Edmund Noble
@edmundnoble
LMAO
Rob Norris
@tpolecat
My scala world talk from last year touches on Free as a special case of Fix, which is another angle on getting an intuition. I didn't really get it until I approached it from that direction.
@edmundnoble what's your talk on?
Edmund Noble
@edmundnoble
TYPES
Rob Norris
@tpolecat
You're still TBD on the schedule, which is an improvement on the entire schedule being TBD as it was last year.
Edmund Noble
@edmundnoble
...in Scala
Rob Norris
@tpolecat
Types? pfft
what have types done for us lately
Mike (stew) O'Connor
@stew
proposition us
Edmund Noble
@edmundnoble
Data types and interface types are used for different reasons in OO than in pure FP, I'm going to explore the difference with a view to eliminating data types from almost all of your code
(well the pure stuff, anyway)
And making your code both more modular/parametric and more performant at the same time
Aman Bhurji
@aman-rally
Looking forward to that video!
Edmund Noble
@edmundnoble
Thanks :D me too
Alexander Konovalov
@alexknvl
case class Free[F[_], A](resume: Either[A, F[Free[F,A]]]) is "data" assuming F is, cats impl is always "co-data".
inductive, co-inductive?
Edmund Noble
@edmundnoble
You could look at it that way, I don't know how useful it is though
Seeing as you have to consume it all to interpret it
Whereas Cofree, you interpret other comonads into
Alexander Konovalov
@alexknvl
That's pretty useful if you want to guarantee termination :)
Although in most cases you don't.
Edmund Noble
@edmundnoble
Yeah that's the canonical issue with Free, all bottoms are the same in some sense
Rob Norris
@tpolecat
I think it's useful to play around with a strict/finite implementation because it's very simple.
The structure is totally obscured in the cats/scalaz impls.
Edmund Noble
@edmundnoble
It's also nice for just growing leafy trees
I appreciate step being constant-time
Jacob Barber
@Jacoby6000
Does cats have an implementation for ForAll? I can't find one
Edmund Noble
@edmundnoble
Nope
Jacob Barber
@Jacoby6000
D:
Any reason why?
I'll make a PR to add it if not.
Edmund Noble
@edmundnoble
Please do, take that from alexknvl/polymorphic probably
Jacob Barber
@Jacoby6000
:thumbsup:
Jacob Barber
@Jacoby6000
I can not so proudly say I don't understand that implementation at all. lol
Edmund Noble
@edmundnoble
It has no boxing and nice syntax
Alexander Konovalov
@alexknvl
And also the trick with unstable types...
And the trick with final class Foo(val b: Boolean = true) extends AnyVal
Edmund Noble
@edmundnoble
Ugh that trick gives me shame
Alexander Konovalov
@alexknvl
Why? it's quite ingenious.
@Jacoby6000 I think even trait Forall[F[_]] { def apply[A]: F[A] } version is better than nothing.
Doesn't require a separate syntax import
Harrison Houghton
@hrhino
which trick gives you shame?
Jacob Barber
@Jacoby6000
@alexknvl that's what I was leaning toward... But realistically that's so simple that I don't feel like it contributes much.
(unless it can start being applied to already existing parts of the codebase)

Hm... I know implicit conversions are bad, but is

implicit def forallA[F[_], A](forall: ForAll[F]): F[A] = forall.apply[A]

bad?

I imagine things would be weird whenever you start composing stuff
Jacob Barber
@Jacoby6000
Applicative should be sufficient, i think.