Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 13:22
    ckipp01 converted_to_draft #11257
  • 13:20
    ckipp01 labeled #16837
  • 13:20
    ckipp01 unlabeled #16837
  • 13:19
    ckipp01 labeled #16837
  • 13:18
    ckipp01 review_requested #16837
  • 13:18
    ckipp01 review_requested #16837
  • 13:18
    ckipp01 opened #16837
  • 13:09
    nicolasstucki labeled #16829
  • 13:08
    nicolasstucki assigned #16835
  • 13:08
    nicolasstucki commented #16835
  • 12:49
    ckipp01 closed #16831
  • 12:49
    ckipp01 commented #16831
  • 12:26
    Linyxus closed #16416
  • 12:26
    Linyxus commented #16416
  • 12:26
    Linyxus closed #16553
  • 12:26
    Linyxus commented #16553
  • 12:11
    szymon-rd commented #16806
  • 11:08
    vasilmkd-jetbrains synchronize #16810
  • 11:04
    soronpo commented #16818
  • 09:56
    mbovel labeled #16818
Guillaume Martres
@smarter
putting a reference to the corresponding fix in scalac in the commit message is also nice
Sébastien Doeraene
@sjrd
of course
Guillaume Martres
@smarter
psst, while you're looking at primitive ops in the backend, you might also want to port https://github.com/scala/scala/pull/7435/files :)
Sébastien Doeraene
@sjrd
TBH I'm focusing on things that get me closer to implementing and testing the Scala.js backend.
For the int-shift-long I needed the fixes in the constant-folder, and I couldn't reasonably fix the constant-foler but not the backend...
Andrey
@sugakandrey
@smarter after watching a video on types in dotty, I was under the impression that something like Function1[String, Int] was encoded as a RefinedType and not AppliedType, but looking into the codebase it looks like it is AppliedType after all. Also, the docs and the comments mention that each case in match type is either an unary function or a type lambda over unary function, but now there is some synthetic MatchCase type. Is it just implementation details or were there any underlying problems with previous encodings?
Guillaume Martres
@smarter
@sugakandrey Yeah the refinement encoding for applied types was abandoned a while ago
Andrey
@sugakandrey
Also, are there plans to adapt SLS to dotty/3.0? :)
Guillaume Martres
@smarter
First, because we couldn't make it work well enough with higher-kinded types (https://infoscience.epfl.ch/record/222780/files/p51-odersky.pdf), then we tried to use it only for applying class types but it didn't seem worth it, and it made handling of wildcard applications more complicated (you want to be able to distinguish C from C[_], but if you encode application as refinement you can't really do that)
Yes, eventually the spec will be updated
Andrey
@sugakandrey
Makes sense, thanks for the clarification. Looking through the commit history, it looks like the MatchCase is a fairly recent addition.
Matthew Pocock
@drdozer
hey - I've got some higly parameterised code that's ended up building heavily left-nested tuples e.g. (((((((((((((String, Int), String), String), Char), Int), Char), String), Char), Int), Char), pdb.HelixClass), String), Int)
Is there a way to combine a new element onto the right of an existing tuple that doesn't cause this profligate nesting?
Guillaume Martres
@smarter
String *: Int *: String *: Unit should work
The last element must be Unit or a tuple
Matthew Pocock
@drdozer
thanks - is there a typeclass or whitness to that?
def f[A, B](a: A, b: B) = a *: b needs something to say that B is a type with *:
Guillaume Martres
@smarter
this is just syntactic sugar for tuples
or more precisely, in Dotty the type (A,B) is syntactic sugar for the type A *: B *: Unit
Matthew Pocock
@drdozer
thanks - adding the type bounds B <: Tuple has caused a compiler crash ...
(Compile / compileIncremental) java.nio.file.NoSuchFileException: /drone/src/github.com/lampepfl/dotty/library/src-3.x/scala/Tuple.scala
shall I open an issue?
Martin Egri
@megri
@smarter I've always thought Unit is just a type and () is its singleton instance. Is it a symbol in Dotty?
Guillaume Martres
@smarter
What ?
Unit is a type and () is the single instance of that type yes
not sure what you mean by symbol
Martin Egri
@megri
Oh I misread your earlier comment. So in Dotty tuples can be created like 1 *: 2 *: 3 *: () ? :)
Neither am I to be honest ;) I always mix up types and terms and symbols and those abstract words.
Well, Types are pretty obvious.
Jakub Kozłowski
@kubukoz
Has new type Foo = Int been considered as syntax for opaque types? It doesn't require any new keywords (unlike opaque)
Also, A *: () is totally kiss syntax
odersky
@odersky
There are some comments on new type at the end of the Opaque Types thread on Discourse.
Martin Egri
@megri
@kubukoz kiss like Unit kisses A?
Jakub Kozłowski
@kubukoz
@odersky thank, will look
@megri yeah, reads RTL :joy:
Matthew Pickering
@mpickering
Just to clear things up: The dotty principled metaprogramming implementation doesn't have implicit cross-stage persistence for values but does for types?
I am also a bit unclear about the representation for quotations, is the representation syntax trees which are explicitly typed and contain implicit evidence?
Matthew Pickering
@mpickering
It seems that the syntax was changed at some point to use ~ rather than $ but the documentation has not been updated .https://dotty.epfl.ch/docs/reference/other-new-features/principled-meta-programming.html
odersky
@odersky
The docs about meta programming are currently outdated. @biboudis and @nicolasstucki are preparing new docs.
Andriy Plokhotnyuk
@plokhotnyuk
:+1:
Rich
@Rich2
I was looking at the doc on Typeclass derivation and there didn't seem to be any facility for ad-hoc sum types.
Matthew Pocock
@drdozer
hey - just wondering - is there a reason that postfix decorator syntax works only on single values, and not on full argument lists?
trait PdbColumn[C[_], T] {
  def (charStart: Int, charEnd: Int, field: String, definition: String) col[T]: C[T]
}
So I can't do this, sadly
The hack is:
trait PdbColumn[C[_], T] {
  def col[T](charStart: Int, charEnd: Int, field: String, definition: String): C[T]
  def (ts: Tuple4[Int, Int, String, String]) col[T]: C[T] = col[T](ts._1, ts._2, ts._3, ts._4)
}
Alessandro Vermeulen
@spockz
It seems that the link to multiversal equality on the homepage is broken: http://dotty.epfl.ch/docs/reference/other-new-features/multiversal-equality.html << gives a 404}
PR to update broken links are welcome
Xavier GUIHOT
@xavierguihot
Hi, playing with the new parameter untupling feature; any plans to also have the possibility to do this in the future?
def f(a: Int, b: Int): Int = a * b
List((1, 2), (3, 4)).map(f(_, _ * 2))