Skip to content
  • Home Home Home, current page.
  • Moments Moments Moments, current page.

Saved searches

  • Remove
  • In this conversation
    Verified accountProtected Tweets @
Suggested users
  • Verified accountProtected Tweets @
  • Verified accountProtected Tweets @
  • Language: English
    • Bahasa Indonesia
    • Bahasa Melayu
    • Català
    • Čeština
    • Dansk
    • Deutsch
    • English UK
    • Español
    • Filipino
    • Français
    • Hrvatski
    • Italiano
    • Magyar
    • Nederlands
    • Norsk
    • Polski
    • Português
    • Română
    • Slovenčina
    • Suomi
    • Svenska
    • Tiếng Việt
    • Türkçe
    • Ελληνικά
    • Български език
    • Русский
    • Српски
    • Українська мова
    • עִבְרִית
    • العربية
    • فارسی
    • मराठी
    • हिन्दी
    • বাংলা
    • ગુજરાતી
    • தமிழ்
    • ಕನ್ನಡ
    • ภาษาไทย
    • 한국어
    • 日本語
    • 简体中文
    • 繁體中文
  • Have an account? Log in
    Have an account?
    · Forgot password?

    New to Twitter?
    Sign up
propensive's profile
Jon Pretty
Jon Pretty
Jon Pretty
@propensive

Tweets

Jon Pretty

@propensive

Supporting Scala through professional training and open-source software. Responsible for Magnolia, Fury, Scala World and Functional Africa.

Europe
propensive.com
Joined July 2010

Tweets

  • © 2021 Twitter
  • About
  • Help Center
  • Terms
  • Privacy policy
  • Cookies
  • Ads info
Dismiss
Previous
Next

Go to a person's profile

Saved searches

  • Remove
  • In this conversation
    Verified accountProtected Tweets @
Suggested users
  • Verified accountProtected Tweets @
  • Verified accountProtected Tweets @

Promote this Tweet

Block

  • Tweet with a location

    You can add location information to your Tweets, such as your city or precise location, from the web and via third-party applications. You always have the option to delete your Tweet location history. Learn more

    Your lists

    Create a new list


    Under 100 characters, optional

    Privacy

    Copy link to Tweet

    Embed this Tweet

    Embed this Video

    Add this Tweet to your website by copying the code below. Learn more

    Add this video to your website by copying the code below. Learn more

    Hmm, there was a problem reaching the server.

    By embedding Twitter content in your website or app, you are agreeing to the Twitter Developer Agreement and Developer Policy.

    Preview

    Why you're seeing this ad

    Log in to Twitter

    · Forgot password?
    Don't have an account? Sign up »

    Sign up for Twitter

    Not on Twitter? Sign up, tune into the things you care about, and get updates as they happen.

    Sign up
    Have an account? Log in »

    Two-way (sending and receiving) short codes:

    Country Code For customers of
    United States 40404 (any)
    Canada 21212 (any)
    United Kingdom 86444 Vodafone, Orange, 3, O2
    Brazil 40404 Nextel, TIM
    Haiti 40404 Digicel, Voila
    Ireland 51210 Vodafone, O2
    India 53000 Bharti Airtel, Videocon, Reliance
    Indonesia 89887 AXIS, 3, Telkomsel, Indosat, XL Axiata
    Italy 4880804 Wind
    3424486444 Vodafone
    » See SMS short codes for other countries

    Confirmation

     

    Welcome home!

    This timeline is where you’ll spend most of your time, getting instant updates about what matters to you.

    Tweets not working for you?

    Hover over the profile pic and click the Following button to unfollow any account.

    Say a lot with a little

    When you see a Tweet you love, tap the heart — it lets the person who wrote it know you shared the love.

    Spread the word

    The fastest way to share someone else’s Tweet with your followers is with a Retweet. Tap the icon to send it instantly.

    Join the conversation

    Add your thoughts about any Tweet with a Reply. Find a topic you’re passionate about, and jump right in.

    Learn the latest

    Get instant insight into what people are talking about now.

    Get more of what you love

    Follow more accounts to get instant updates about topics you care about.

    Find what's happening

    See the latest conversations about any topic instantly.

    Never miss a Moment

    Catch up instantly on the best stories happening as they unfold.

    1. Jon Pretty‏ @propensive 18 Dec 2019

      @LukaJacobowitz I thought about the problems with type subtraction in Scala some more. The types A and B represent sets of properties provable on values of those types. They must have a least upper-bound, which will be the (nonempty) intersection of those sets. (1/11)

      1 reply 0 retweets 3 likes
      Show this thread
    2. Jon Pretty‏ @propensive 18 Dec 2019

      They also have a greatest lower-bound, which is the union of the properties, and (in Dotty) is the intersection type, A & B. (2/11)

      1 reply 0 retweets 1 like
      Show this thread
    3. Jon Pretty‏ @propensive 18 Dec 2019

      If we want to "remove" a type from the intersection, then we need to define ∖ such that (A & B) ∖ B = A. If we try to define that for abstract types in terms of the existing type machinery we have, we can't do it. The result of T ∖ S depends on the T ∩ S. (3/11)

      1 reply 0 retweets 2 likes
      Show this thread
    4. Jon Pretty‏ @propensive 18 Dec 2019

      So we would either need to create a new fundamental type structure for representing such types, preserving it until such time as the types are reified, or we restrict usage of ∖ to concrete types, in the same way that type projection (#) is. (4/11)

      1 reply 0 retweets 0 likes
      Show this thread
    5. Jon Pretty‏ @propensive 18 Dec 2019

      Supporting the former is a lot of work, I think. It would be a new concept which would need proving (probably at great length) for all of DOT's existing type operations. I'm not certain, but I think that's not an option. (5/11)

      1 reply 0 retweets 0 likes
      Show this thread
    6. Jon Pretty‏ @propensive 18 Dec 2019

      If we restrict it to concrete types, it seems a little ugly that it would be another constraint on abstract types. And unfortunately, I think methods like, def foo[T, S](f: F[T], s: S): F[T \ S] = ??? are quite likely to be most—if not all—of the useful cases. (6/11)

      1 reply 0 retweets 1 like
      Show this thread
    7. Jon Pretty‏ @propensive 18 Dec 2019

      Another issue is that the type T \ S probably wouldn't do what we want anyway. A field, val t: T \ S could still quite happily, by Liskov Substitution, hold a value of type S, if that value is also a subtype of T. We couldn't prevent it without redefining Liskov. (7/11)

      1 reply 0 retweets 0 likes
      Show this thread
    8. Jon Pretty‏ @propensive 18 Dec 2019

      In general, the compiler could prove that T <: (T \ S), and that (T \ S₂) <: (T \ S₁) ∀ S₁ <: S₂, and that may be useful. But reasoning about more complex types such as wildcards in variant positions, or S \ (T \ U) is less obvious. Not necessarily impossible, though. (8/11)

      2 replies 0 retweets 0 likes
      Show this thread
    9. Jon Pretty‏ @propensive 18 Dec 2019

      Note that all this complexity arises because the types aren't disjoint. And that's not a distinction the compiler makes, so we can't even limit the usage of ∖ to disjoint sets of types. (9/11)

      1 reply 0 retweets 0 likes
      Show this thread
    10. Jon Pretty‏ @propensive 18 Dec 2019

      So, in general, I think this isn't viable without fundamentally adding complexity to the type system. If there were a way to restrict its use to disjoint types, it might be possible, maybe even sitting "on top of" the existing type system, like exaustivity checking does. (10/11)

      1 reply 0 retweets 0 likes
      Show this thread
      Jon Pretty‏ @propensive 18 Dec 2019

      But without that constraint, I think that having a value s conform to both S and T \ S would be confusing to say the least. (11/11)

      6:46 AM - 18 Dec 2019
      • 1 Like
      • Itamar Ravid
      1 reply 0 retweets 1 like
        1. Jon Pretty‏ @propensive 18 Dec 2019

          And sorry this took me so long, @LukaJacobowitz. It was interesting stepping through it logically, so thanks for the impetus... I hadn't considered it in this much detail before.

          0 replies 0 retweets 1 like
          Show this thread
          Thanks. Twitter will use this to make your timeline better. Undo
          Undo

      Loading seems to be taking a while.

      Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.

        Promoted Tweet

        false

        • © 2021 Twitter
        • About
        • Help Center
        • Terms
        • Privacy policy
        • Cookies
        • Ads info