Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 19:57
    nevillelyh commented #8289
  • 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
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
segeljakt
@segeljakt
ok
Seth Tisue
@SethTisue
normally when we say “arity” we’re talking about functions
idk, I guess we say it about tuples
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
btw I can explain most of those terms if you want, I just don't want to throw a ton of info at you at once
Ichoran
@Ichoran
Arity just means "how many arguments". It doesn't tell you whether they are type arguments or value arguments.
Or what you pack them into.
segeljakt
@segeljakt
I should not have wrote it like that
1-kind: Foo[A]
2-kind: Foo[A,B]
3-kind: Foo[A,B,C]
…?
Fabio Labella
@SystemFw
ehm, kind of
no pun intended
segeljakt
@segeljakt
lol
Fabio Labella
@SystemFw
your notation is too imprecise
the 1-kind, 2-kind thing
Ichoran
@Ichoran
Mathematical vectors have arity, for instance. v = (a, b) is a 2-ary vector.
segeljakt
@segeljakt
(y)
How would you explain kinds?
Fabio Labella
@SystemFw
it cannot distinguish between Either[A, B] and Free[F, R] (the F there can be IO, not Int, whereas the A in Either can be IO[Int], or String, but not IO)
that's the explanation I use for kinds
first of all, talking about kinds in Scala is a bit weird, the notation is not great
so I'm going to use Haskell notation, which is std, and show you the translation to scala
basically it starts with types
a type is a compile time label that's attached to a term (a term is a value like 1 or "hello" or map), which can be used to statically prove the absence of certain behaviour
Ichoran
@Ichoran
Haskell notation is basically the optimal notation for talking about types, anyway. It's like someone took that notation and built a programming language around it.
Fabio Labella
@SystemFw
or in layman terms, a type is a way of classifying value (but try to understand the definition above, because that's the correct one)
similarly, there are labels to classify types themselves
these labels are called kinds
segeljakt
@segeljakt
types give values meaning?
Fabio Labella
@SystemFw
that's a cool sentence but it doesn't really mean anything :)
traditionally, a kind system is quite simple
Ichoran
@Ichoran
Types just express what you know about a value (which may or may not not be its actual value) without running the program.
Fabio Labella
@SystemFw
by traditionally I mean in SystemFw, or roughly in Haskell, and it's basically a simply typed lambda calculus at the type level. Which means this
imagine there is no subtyping
like in Haskell
Ichoran
@Ichoran
Kinds are a way to classify your types.
Fabio Labella
@SystemFw
then for some types, you can immediately create values
e.g. if I tell you type Int, you know that 1 is a value
if I tell you String, you know that "hello" is a value
if I tell you Option[Int], you know that None and Some(4) are values
and so on
segeljakt
@segeljakt
ok