Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 09 2019 16:41
    Atry added as member
  • Sep 06 2019 16:11
    tw-data-china-go-cd removed as member
  • Sep 06 2019 16:08
    Atry removed as member
  • Nov 08 2017 07:52

    Atry on master

    Update README.md (compare)

  • Jun 03 2017 13:48

    Atry on provided-dependency

    Update build.sbt (compare)

  • Mar 11 2017 03:09

    Atry on master

    Update README.md (compare)

  • Mar 11 2017 03:07

    Atry on master

    Update README.md (compare)

  • Mar 10 2017 18:15

    tw-data-china-go-cd on v2.0.0

    (compare)

  • Mar 10 2017 18:15

    tw-data-china-go-cd on master

    Setting version to 2.0.0 Setting version to 2.0.1-SNAPSH… (compare)

  • Mar 10 2017 18:10

    Atry on master

    Fix compilation error on Scala … (compare)

  • Mar 10 2017 18:07

    Atry on master

    Rename deploy.sbt.disabled to d… (compare)

  • Mar 10 2017 18:06

    Atry on master

    Update README.md (compare)

  • Mar 10 2017 18:05

    Atry on master

    Setup scalafmt Add Foo@Bar syntax Add (since 2.0) (compare)

  • Dec 31 2016 16:05

    Atry on master

    Update README.md (compare)

  • Dec 28 2016 13:44

    Atry on master

    Update README.md (compare)

  • Dec 28 2016 02:54

    Atry on master

    Update README.md (compare)

  • Dec 28 2016 02:54

    Atry on master

    Update README.md (compare)

  • Dec 28 2016 02:41

    Atry on master

    Update README.md (compare)

  • Dec 28 2016 02:41

    Atry on master

    Update README.md (compare)

  • Dec 28 2016 02:40

    Atry on master

    Update README.md (compare)

Miles Sabin
@milessabin
Hi there!
Interesting plugin :-)
Have you thought about how something like this might be included directly in the language?
Yang, Bo
@Atry
Of cource. I didn't understand why scala limit prefix of a type to stable id only
Yang, Bo
@Atry
@milessabin Is there any previous discussion about removing the limitation of stable id?
Miles Sabin
@milessabin
You'll find a few scattered discussions on the mailing list and in the issue tracker. There's also @uncheckedStable (which doesn't work unfortunately).
I have a vague memory of a discussion I had with @adriaanm years ago about allowing implicitly to generate stable prefixes for precisely this reason. I can't find it now.
Yang, Bo
@Atry

I guess the reason of stable id checking is keeping the integrity of Scala's self-type checking.

However, I think that is not necessary if Scala create existential types for unstable values.

For example:

def genericNone: Generic.Aux[None.type, HNil] = Generic[None.type] // Unstable

// This type alias should equal to:
// type ConcreteRepr = tmpUnstableVariable.Repr forSome { val tmpUnstableVariable: Generic.Aux[None.type, HNil] }
type ConcreteRepr = genericNone.Repr

// This type alias should expand to HNil because tmpUnstableVariable.Repr is a concret type
implicitly[AbstractRepr =:= HNil]
def genericNone: Generic.Aux[None.type] = Generic[None.type] // Unstable

// This type alias should equal to:
// type AbstractRepr = tmpUnstableVariable.Repr forSome { val tmpUnstableVariable: Generic[None.type] }
type AbstractRepr = genericNone.Repr

// This type alias should expand to `_ <: Any` because tmpUnstableVariable.Repr is an abstract type
implicitly[AbstractRepr <:< Any]
Yang, Bo
@Atry
@milessabin I wonder if this change could be merged into the SIP 42.type . As the SIP has been removed the limitation of prefixes of stable AnyVal and literals. Why not allow any expression prefixes?
Once unstableExpression.type is allowed. unstableExpression.Reprbecome legal automatically, because unstableExpression.Repr is the same meaning as unstableExpression.type#Repr according to Scala Language Specification
Miles Sabin
@milessabin
It would definitely be in the spirit of the literal types work.
Would you like to investigate?
Yang, Bo
@Atry
What would you expect me to do?
Miles Sabin
@milessabin
Nothing that you wouldn't want to do :-)
Yang, Bo
@Atry
Does "investigate" mean becoming a typelevel member?
Miles Sabin
@milessabin
Play around with the PR and see if there's any easy way to stabilize suitable paths.
Typelevel doesn't have a formal membership model for individuals.
Members are projects.
Which are all FLOSS and eager to have contributors.
Yang, Bo
@Atry
Is there any documentation about typelevel project membership?
Miles Sabin
@milessabin
It's mainly captured here: typelevel/general#5
Yang, Bo
@Atry
I could create a PR for the PR of 42.type SIP documentation. But I guess I will delay months of time to implement the feature on the reference implemenation.
Miles Sabin
@milessabin
I really just meant dig around for an hour or so and see what you can uncover if you're feeling enthusiastic.
Yang, Bo
@Atry
Do you have any thought about unstableExpression.type
Will it cause ambiguity in Scala parser?
Another problem is side effects. Should the compile ignore all side effects in unstableExpression.type?
C++'s decltype does ignore all side effects.
Miles Sabin
@milessabin
I think I would expect the semantics of val foo: <expr>.T = ... to be equivalent to those of lazy val e = <expr>; val foo: e.T = ....
No side effects are performed in that case.
scala> trait Foo { type T }
defined trait Foo

scala> lazy val e: Foo { type T = Int } = ???
e: Foo{type T = Int} = <lazy>

scala> val foo: e.T = 23
foo: e.T = 23
Yang, Bo
@Atry
I agree.
Because e is a hidden variable inside the type position. It becomes an exsistential type for the outside world.
Miles Sabin
@milessabin
Yes, I think that's probably right.