Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 05 20:16
    SethTisue commented #9656
  • Aug 05 18:57
    som-snytt commented #4302
  • Aug 05 14:28
    SethTisue synchronize #1265
  • Aug 05 14:25
    SethTisue milestoned #7515
  • Aug 05 14:06
    tkawachi closed #2148
  • Aug 05 14:06
    tkawachi commented #2148
  • Aug 05 13:21
    som-snytt commented #7515
  • Aug 05 13:21
    som-snytt edited #7515
  • Aug 05 12:07
    myazinn commented #12440
  • Aug 05 11:56
    som-snytt closed #12440
  • Aug 05 11:56
    som-snytt commented #12440
  • Aug 05 10:26
    myazinn edited #12440
  • Aug 05 10:24
    myazinn opened #12440
  • Aug 05 08:47

    nicolasstucki on main

    Clean up grammar and other nit … Clean up grammar and other nit … Clean up grammar and other nit … and 2 more (compare)

  • Aug 05 08:47
    nicolasstucki closed #2121
  • Aug 05 08:46
    nicolasstucki assigned #2148
  • Aug 05 08:26
    sjrd commented #1265
  • Aug 05 08:23
    lrytz edited #12439
  • Aug 05 08:23
    lrytz milestoned #12439
  • Aug 05 08:23
    lrytz opened #12439
Fabio Labella
@SystemFw
well, that case is weird
well, not weird
but not strictly parametric polymorphism either, it's interacting with variance and sub typing there
Harrison Houghton
@hrhino
as opposed to, say, inheritance polymorphism, which is done by having an interface as a superclass of everything you want to accept
ah, true
Fabio Labella
@SystemFw
basically in a language with no sub typing, that would be an example of parametric polymorphism that doesn't compile :)
ah, you changed it
now it doesn't compile in Scala either :)
Klas Segeljakt
@segeljakt
oh
is Seq not covariant?
Fabio Labella
@SystemFw
ah, with Seq yeah, it does
Martijn Hoekstra
@martijnhoekstra
T is inferred to be Any - so the question is also "what kind of polymorphism is def func(l: Any*) = ???; func(3, "abc", 'o')" - to which the answer is "that not polymorphism, that's just making me cry"
Fabio Labella
@SystemFw
yeah pretty much
Klas Segeljakt
@segeljakt
I thought the first one was first-class monomorphic and the second one was second-class polymorphic
I don’t know the terms strictly
Fabio Labella
@SystemFw
yeah, no
that doesn't make a lot of sense :)
Harrison Houghton
@hrhino

@martijnhoekstra

        if (treeInfo.mayBeVarGetter(varsym)) {
          lhs1 match {
            case treeInfo.Applied(Select(qual, name), _, _) =>
              val sel = Select(qual, name.setterName) setPos lhs.pos
              val app = Apply(sel, List(rhs)) setPos tree.pos
              return typed(app, mode, pt)

            case _ =>
          }
        }

so yeah, it's doing a naïve name-based lookup. if you don't feel like filing a bug, lmk and I will

Klas Segeljakt
@segeljakt
Second class = upcast to common supertype?
Fabio Labella
@SystemFw
no, that terminology doesn't really exist afaict
Klas Segeljakt
@segeljakt
"So here we have the crux of the problem — we can have first-class monomorphic function values and we can have second-class polymorphic methods, but we can’t have first-class polymorphic function values … at least we can’t with the standard Scala definitions. And yet it’s first-class polymorphic function values that we need to map over an HList … what to do?"
Fabio Labella
@SystemFw
no, first class polymorphism is a different thing
Klas Segeljakt
@segeljakt
ok
Fabio Labella
@SystemFw
it's a more advanced topic
but it's got nothing to do with what you are talking about
Martijn Hoekstra
@martijnhoekstra
@hrhino don't you give me that nme pos tpe app pt qual tr gobbledygook - I run Windows and I'm pretty sure those are just part of GNU powertools
Harrison Houghton
@hrhino
watch me. you get lhs and sel too
and my favourite, mk
Klas Segeljakt
@segeljakt
Ok, I’m wondering, how would you define what an HList is
Fabio Labella
@SystemFw
in what sense?
Klas Segeljakt
@segeljakt
compared to a regular List
Martijn Hoekstra
@martijnhoekstra

No command 'sel' found, but there are 18 similar ones

oh, thanks Bash. That's helpful.

Fabio Labella
@SystemFw
@klassegeljakt a heterogenous list
Klas Segeljakt
@segeljakt
Ok, compared to a List it preserves type information of each element. Compared to a Tuple, it abstracts over arity
Justin du Coeur, AKA Mark Waks
@jducoeur
Correct.
Klas Segeljakt
@segeljakt
is it “arity polymorphic”?
or do you call it something else
Fabio Labella
@SystemFw
it doesn't really abstract over arity on its own
it just happens to have an inductive structure
and one can use typeclasses to "abstract over arity"
But I wouldn't call an HList arity polymorphic, personally
Klas Segeljakt
@segeljakt
ok
Seth Tisue
@SethTisue
normally when we say “arity” we’re talking about functions
idk, I guess we say it about tuples
Klas Segeljakt
@segeljakt
is it
def foo[<kinds>](<arity>) = …
Seth Tisue
@SethTisue
as Fabio indicates, an HList is really just a series of nested tuples of arity 2
Fabio Labella
@SystemFw
kinds there also doesn't make sense :)
those are type parameters
a kind is a different thing