question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Clarify the reasons for dropping existentials

See original GitHub issue

Dotty documentation lists three reasons why existentials were dropped.

  • Existential types violate a type soundness principle on which DOT and Dotty are constructed. That principle says that every prefix (p, respectvely S) of a type selection p.T or S#T must either come from a value constructed at runtime or refer to a type that is known to have only good bounds.

Can this be illustrated on an example? What’s a snippet of code that uses existentials and is problematic in this respect?

  • Existential types create many difficult feature interactions with other Scala constructs.

This is a little too vague of an explanation for users who are going to miss existentials.

  • Existential types largely overlap with path-dependent types, so the gain of having them is relatively minor.

I disagree that the gain is minor.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:22 (18 by maintainers)

github_iconTop GitHub Comments

6reactions
hobwekivacommented, Apr 25, 2018

@TomasMikula You can make a newtype for existentials which works pretty well in Scala2 and doesn’t box.

    type Type[+F[_]] <: (Any { type T })

    def wrap[F[_], A](value: F[A]): Type[F] =
        value.asInstanceOf[Type[F]]

    def unwrap[F[_]](value: Type[F]): F[value.T] =
        value.asInstanceOf[F[value.T]]
4reactions
RossTatecommented, Apr 23, 2018

Tate, Leung and Learner have explored some possible explanations in [11], but their treatment raises about as many questions as it answers.

Hah, I love this quote! I’d never seen it before, but I totally get it. Sorry the work doesn’t help y’all except to warn just how complicated the problem gets.

I have other work on checking/inferring existential types, but unfortunately it doesn’t work for impredicative existential types, which is the case y’all particularly care about. Nonetheless, there are probably some useful lessons to learn from the predicative case if y’all are interested.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Existentialism | Internet Encyclopedia of Philosophy
This very broad definition will be clarified by discussing seven key themes that existentialist thinkers address. Those philosophers considered existentialists ...
Read more >
Existentialism - Stanford Encyclopedia of Philosophy
Husserl employed this method to clarify our experience of nature, ... His sole justification is what Kierkegaard calls the passion of faith.
Read more >
Existentialism - Wikipedia
Existentialism is a form of philosophical inquiry that explores the problem of human existence and centers on human thinking, feeling, and acting.
Read more >
Dropped: Existential Types - Scala 3 - EPFL
The reasons for dropping them are: Existential types violate a type soundness principle on which DOT and Scala 3 are constructed. That principle...
Read more >
A student's guide to Jean-Paul Sartre's Existentialism and ...
The truth about the horrors of Auschwitz and Dachau was emerging; the atom bomb had been dropped for the first time – evidence...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Hashnode Post

No results found