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
yeah, imho is the best way of explaining things but it doesn't fare very well in "what's the point of monads" pub conversations (or reddit flamewars) :P
note that the fact that algebras only describe part of the behaviour of a data type really is crucial: if you understand that, you realise that "how do I extract a value out of a monad" is a question that literally makes no sense on multiple levels : the monad is the algebra, not the type, and extraction appears nowhere in the definition of monad, although it might be part of the behaviour of a given datatype which also happens to form a monad (like State), but makes no sense for others (like IO)
Seth Tisue
@SethTisue
@marcinsokrates_twitter if nobody answers here about Vector branching factor, you might try the scala/contributors room, and/or https://contributors.scala-lang.org
Josh
@joshlemer
I did recently ask about making Vectors of size < 32 use arrays of exactly that size rather than of size 32, @Ichoran responded something to the effect of that allocating the extra bytes are very likely cheaper than the additional logic of handling different array sizes
Also I was specifically thinking that in the case of varargs like in Vector("a","b","c","d"), since in 2.13 these will be passed as an ArraySeq[String], we could just share the underlying array with the arrayseq like...
object Vector {
  def apply[A](elems: A*): Vector[A] = 
    if (elems.length <= 32 && elems.unsafeArray.isInstanceOf[Array[AnyRef]]) { 
      new Vector(0, elems.unsafeArray, 0) 
    } else { ... } 
}
Marcin Sokrates
@marcinsokrates_twitter
@joshlemer I thought about making the two most leafward levels 4 or 8-wide
Need to try it at home
That's neat
Daniel Sebban
@dsebban_twitter
Thanks @SystemFw and @tpolecat for the great explanation on how to explain what a monad is :)
moritz bust
@busti
Is there any good library for doing some very basic vector and matrix mathmatics for graphics in 2d and 3d space?
I would use spire, but I feel like vectors have quite a lot of overhead in it and it does not support matrices.
Josh
@joshlemer
@Busti I haven't used it but there is http://www.scalanlp.org/
moritz bust
@busti
@joshlemer But that feels like it really is more about manipulating large matrices using the GPU. I really just need a 4x4 matrix to work in scala-js
Josh
@joshlemer
Sorry I don't know what would work in scala.js
Peter Aaser
@PeterAaser
Sure wish I knew of gitter when I was trying to figure out monads...
moritz bust
@busti
no worries. It might be smarter to ask the scala-js channel about this.
Peter Aaser
@PeterAaser
By the way, does anyone here use recursion schemes? I found them quite interesting, but I don't really know what sort of problems they are well suited for
Rob Norris
@tpolecat
I use them in a lot of things that never make it into production :-)
Peter Aaser
@PeterAaser
haha
Yeah I don't think it's something I need, but I thought they were cool
And I remember last time I looked at them they made no sense at all to me, and when I looked at them this time it was obvious
pretty great feeling
Rob Norris
@tpolecat
Cool!
I think a lot of the time you can specialize to Free or Cofree so you see those pretty often.
Peter Aaser
@PeterAaser
Yeah, self deprecation aside I do feel I'm getting the hang of programming ;)
Rob Norris
@tpolecat
Cool, what's that like?
Peter Aaser
@PeterAaser
Feels like I can finally make software that is actually good
Rob Norris
@tpolecat
:-)
Peter Aaser
@PeterAaser
I mean I've always claimed I'd never ever cross a bridge that was made by a programmer
and I think that it shouldnt have to be like that
and I feel like I'm getting closer to being able to make software that doesn't fall apart when you look at it wrong :D
Rob Norris
@tpolecat
Anyway I think compilers are probably the canonical use case for recursion schemes because you typically have a bunch of orthogonal annotations and a bunch of passes that you's like to fuse together, so it kind of matches up.
Peter Aaser
@PeterAaser
Yeah, the quasar stuff I saw was really cool
Do you use it in doobie?
Rob Norris
@tpolecat
I have this grand idea for a talk that goes from text file to classfile in one grand hylomorphism but I havent gotten around to figuring out how to do it ;-)
Peter Aaser
@PeterAaser
In what sense, how to make it understandable or how to implement it?
Rob Norris
@tpolecat
Doobie is all built with Free so depending on how much you want to squint it's doing recursion schemy stuff.
Well, both. And how to fit it into a 45-minute talk.
Peter Aaser
@PeterAaser
Just talk really really fast
moritz bust
@busti
hylomorphism sounds really scary
Rob Norris
@tpolecat
Yeah the terminology is really intimidating.
I did a talk at Scala World a few years ago that introduces this stuff pretty gently, if you're interested.
moritz bust
@busti
It is one of those terms where you do not know what to expect in a programming context and then you google it and find out that it is used in philosophy instead.
Rob Norris
@tpolecat
Not even generalized recursion schemes, but enough to get you to understand fixpoint types, which was kind the big mental barrier when I was learning this stuff.
Peter Aaser
@PeterAaser
Yeah, fixpoint types was the difficult part for me too
Rob Norris
@tpolecat
I think the hard part is understanding Fix and ana and cata and then it's just variations of the same ideas.
Peter Aaser
@PeterAaser
it's the sort of thing I like to believe I could explain very easily in an interactive conversation, but not in text or a talk
Fix that is
but in my case just dropping it and coming back to it helped a lot
Rob Norris
@tpolecat
Yeah I had to take a few runs at it before it stuck.
Peter Aaser
@PeterAaser
I just landed a date with a girl who writes C# at her job