Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 19:47
    eed3si9n edited #8591
  • 19:28

    SethTisue on 2.13.x

    2.12: new Scala SHA 2.12: update expected-failure l… add akka-http-webgoat (#1017) and 1 more (compare)

  • 19:08

    SethTisue on 2.11.x

    sbt version bump (1.3.3->1.3.4)… 2.12: new Scala SHA 2.12: update expected-failure l… and 3 more (compare)

  • 19:04
    SethTisue commented #8545
  • 19:03
    som-snytt commented #11824
  • 18:54
    som-snytt labeled #11824
  • 18:54
    som-snytt commented #11824
  • 18:46
    som-snytt review_requested #8591
  • 18:46
    scala-jenkins milestoned #8591
  • 18:46
    som-snytt opened #8591
  • 18:38
    SethTisue milestoned #3237
  • 18:38
    SethTisue assigned #9386
  • 18:38
    SethTisue milestoned #9386
  • 15:21
    som-snytt commented #8590
  • 14:50
    lrytz commented #8588
  • 13:12

    lrytz on 2.13.x

    Avoid length of list Lint confusing by-name conversi… Lint by-name conversion of bloc… and 1 more (compare)

  • 13:12
    lrytz closed #8590
  • 13:12
    lrytz closed #9386
  • 13:12
    lrytz closed #3237
  • 09:36
    dwijnand commented #1016
Dhiraj himani
@dk_hemani_twitter
It took my much time
Thanks for helping out
Alexander Konovalov
@alexknvl
np ;)
Ghost
@ghost~540393fe163965c9bc2018ce
@celik0311 what you're writing looks an awful lot like lines.intercalate("\n") from scalaz
I think the stdlib also gives you .mkString, which is less principled and only works for this one usecase.
Rich
@Rich2
When passing parameters to a super class is there anything wrong with putting a multiline code block in the superclass constructor?
Subclass(a: A, b: B) extends SuperClass({ stuff; stuff; result}, other parameters)
Jose C
@jmcardon
Aside from it being a little odd, I Don't think so
Martijn Hoekstra
@martijnhoekstra
it looks really dodgy to me, but I can't formulate why, so feel free to ignore my dodgy feelings
Jose C
@jmcardon
I don't know why you'd do a calculation to pass a parameter though
It seems like a really strange thing to do
but I've actually never even seen anyone do that so I can't even call it an anti-pattern
Rich
@Rich2
I've got regular rectangular grids that have a min and max x and y coordinates. But I've also got irregular grids that have an Array that gives the min and max x for each row. The calculation is to get the overall min and max x for the irregular grid from the Array.
Rich
@Rich2
Have constructors for non-case classes become unfashionable?
Jose C
@jmcardon
it's not that, just rather that making a calculation inside the constructor paramter is not common in scala, I guess
Rich
@Rich2
No well I can't say I have seen it in other languages either. I guess the syntax is not possible in most languages.
Martijn Hoekstra
@martijnhoekstra
In the scala I write I don't think I've ever inhereied from a superclass with a constructor - but that might say more about me than about scala or whether or not that's a good idea.
Rich
@Rich2
I think not having constructors in traits, I suspect has got Scala developers into the habit of not using them.
Rich
@Rich2

I kind of got the impression that a lot of function programmers were quite receptive when they heard about Scala, a statically typed language for the JVM. But then some of them became quite angry when they discovered that Martin had not merely done the minimum OO to ease compatibility with Java, as say F# did with dot net but had actually expanded the power and capability of OO.

They liked to argue that the benefits of OO were totally outweighed by the costs. By expanding the benefits of OO under Scala Martin had made their argument more difficult. Without Scala OO might have gradually died out. It seems to me that Dotty with trait parameters, type member- parameter unification and soundness rigour of the dot calculus is going to again dramatically increase the OO power of the language. I wonder if we will see a similar reaction.

Martijn Hoekstra
@martijnhoekstra
maybe, I don't know
at the moment I can't remember when the last time was I thought it was useful to subclass a concrete class
maybe in Scala 3 I'll see that again
Fabio Labella
@SystemFw
I'm not sure that type parameter and members are actually fully unified in dotty
iirc when they actually tried to implement HKT that way they hit enough blocks that they had to settle for a direct representation of them instead
trepidacious
@trepidacious
Just looking at https://bartoszmilewski.com/2015/01/20/functors/ challenge 1, and I think that it IS a functor, but I also feel that must be wrong...
Also I can't find a complete set of answers, if there isn't one I could maybe put my answers up to be corrected :)
Fabio Labella
@SystemFw
have you read about the Functor laws?
(it's not a Functor btw)
@trepidacious
trepidacious
@trepidacious
@SystemFw Yup, preserving identity and composing? This makes me think I'm doing it wrongly ;)
Fabio Labella
@SystemFw
yeah, what does the identity law say?
Martijn Hoekstra
@martijnhoekstra
identity is fa.map(a => a) == fa
Fabio Labella
@SystemFw
yep, fmap id = id
then, with the definition in the challenge
Some(1).map(a => a) = None
Jose C
@jmcardon
btw what's the status of opaque types in good ol' dotty
or even in scala 2.13
Fabio Labella
@SystemFw
so defining fmap _ _ = Nothing breaks the identity law (haven't checked composition, but it doesn't matter, we've already seen it's not a Functor)
Martijn Hoekstra
@martijnhoekstra
the opaque types SIP is still pending. If the last SIP meeting was the December meeting, it hasn't been discussed yet
Jose C
@jmcardon
rip that's probably the SIP that I care the most about right now
trepidacious
@trepidacious
@SystemFw Ah yeah I was thinking that since _ => Nothing is the identity of Nothing it was enough, but I guess that is only enough if the type constructor was to Nothing, rather than to Maybe?
Fabio Labella
@SystemFw
see, Nothing can't be a type constructor
Jose C
@jmcardon
because opaque types being 0-cost with no .asInstanceOf casts would be so good
Fabio Labella
@SystemFw
that's where Scala is a bit weird
because Some and None have their own types
but the Functor is for Option
Martijn Hoekstra
@martijnhoekstra
it was on the agenda for last SIP meeting, but it got postponed @jmcardon - I don't know when the next SIP meeting is scheduled. Ask Jorge if you see him about.
trepidacious
@trepidacious
@SystemFw Yes it's the fact that the type constructor is Maybe that I was missing, I was kind of assuming that everything was Nothing ;)
Fabio Labella
@SystemFw
in Haskell is a bit clearer because Just can not be a type (I'm ignoring DataKinds ofc, but even in that case it's not the same)
Jose C
@jmcardon
:(