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.

    Jon Pretty‏ @propensive 6 Jan 2020

    A cautionary tale: not all TreeSets are equal, but some are more equal than others.pic.twitter.com/mMC4bVJFwe

    1:11 PM - 6 Jan 2020
    • 4 Retweets
    • 28 Likes
    • Alexander Huras Jan Stette ⏰ 🛩️ like an 🏹. 🍓🍒🍎 🦟s like a 🍌🔰 Karl Brodowsky Stefano Baghino Fiona Hobbs Chetan Khatri 🇮🇳 Mehmet Akif Tütüncü Flavin Brazir
    6 replies 4 retweets 28 likes
      1. New conversation
      2.  ⏰  🛩️ like an  🏹.  🍓 🍒 🍎  🦟s like a  🍌 🔰‏ @ioupal 6 Jan 2020
        Replying to @propensive

        What's going on here? Did you look under the hood?

        1 reply 0 retweets 0 likes
      3. Jon Pretty‏ @propensive 6 Jan 2020
        Replying to @ioupal @iouwon

        I didn't need to look... what it's doing is as reasonable as what I'm doing is unreasonable: the Ordering I created considers there to be no difference in order between two Foos with the same id. The logic inside TreeSet uses that to equality-of-order to infer equality.

        2 replies 0 retweets 0 likes
      4. Show replies
      1. New conversation
      2. Maxime Kjaer‏ @maximekjaer 6 Jan 2020
        Replying to @propensive

        I'm wondering, does this imply that Ordering should always define a total order? The spec does say that compare(x, y) should return 0 when x == y, and there is a PartialOrdering trait in the library. Should the docs maybe be clearer on this to warn against these subtle bugs?

        1 reply 0 retweets 0 likes
      3. Jon Pretty‏ @propensive 6 Jan 2020
        Replying to @maximekjaer

        Yes, I think Ordering should always be total. As for the docs, though, clarity wasn't the problem. I just didn't think I needed to read them when I decided to use a TreeSet...

        0 replies 0 retweets 0 likes
      4. End of conversation
      1. New conversation
      2. Roland Kuhn‏ @rolandkuhn 6 Jan 2020
        Replying to @propensive

        That ordering is fishy regardless of TreeSet—I must confess that I was also tempted to do this (in different languages). You want set semantics for the ID, plus associated data, which is the definition of a (Tree)Map.

        1 reply 0 retweets 1 like
      3. Jon Pretty‏ @propensive 6 Jan 2020
        Replying to @rolandkuhn

        Yes, agreed. But as my ID is part of my data, I wanted to eliminate the possibility of storing the data against the wrong ID. I can entertain the idea of removing the ID from the data itself, though...

        1 reply 0 retweets 0 likes
      4. Show replies
      1. Rüdiger Klaehn‏ @klaehnr 7 Jan 2020
        Replying to @propensive

        The ordering is not consistent with the equality. In @typelevel cats laws there is a rule to make sure that this is the case, so this issue would have been found by the law checks. (c == 0) == E.eqv(x, y) https://github.com/typelevel/cats/blob/master/kernel-laws/shared/src/main/scala/cats/kernel/laws/OrderLaws.scala#L15 …

        0 replies 0 retweets 3 likes
        Thanks. Twitter will use this to make your timeline better. Undo
        Undo
      1. New conversation
      2. Jakub Kozłowski‏ @kubukoz 7 Jan 2020
        Replying to @propensive

        Isn't that any SortedSet? I think this is the first case sets bit me a couple years ago...

        1 reply 0 retweets 0 likes
      3. Jon Pretty‏ @propensive 7 Jan 2020
        Replying to @kubukoz

        Maybe all the stdlib implementations, but you could implement a `SortedSet` which overrides `equals`.

        1 reply 0 retweets 0 likes
      4. Show replies
      1. New conversation
      2. Zhenhao Li‏ @data_fly 7 Jan 2020
        Replying to @propensive

        how does `==` work in this case? (I knew that you put both values into the same TreeSet, the later value will replace the former one because your ordering instance defines possible "positions" in the tree. I used this fact to implement small key-value stores in memory.)

        1 reply 0 retweets 0 likes
      3. Jon Pretty‏ @propensive 7 Jan 2020
        Replying to @data_fly

        I didn't check, but I imagine the implementation walks both trees in parallel comparing one to the other using the Ordering to check that compare(leftElem, rightElem) == 0 for all of them.

        0 replies 0 retweets 1 like
      4. End of conversation

    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