Giter Club home page Giter Club logo

Comments (5)

DavidArno avatar DavidArno commented on June 19, 2024

Looking at the code around the == operators for Option<T> and Maybe<T>, I think maybe I'd had at least ten too many beers when writing that stuff! 😨 It looks like a classic example of "just keep adding more crap until the tests pass".

Time for a serious bit of refactoring...

from succinct.

DavidArno avatar DavidArno commented on June 19, 2024

Accidentally checked in the fix for this with the commit of the 4th May. Comparisons between options, maybes and null are greatly simplified.

from succinct.

DavidArno avatar DavidArno commented on June 19, 2024

Bug fix included in the v3.0.0 release.

from succinct.

Opiumtm avatar Opiumtm commented on June 19, 2024

It's not as simple as it seems.

SQL null comparison rules state that any comparison to null value returns false.
According to SQL rules, null = null check result is false.

It's not clear which null comparison standard is "true".

from succinct.

megafinz avatar megafinz commented on June 19, 2024

It's not clear which null comparison standard is "true".

How is that? Why do we care about SQL rules? In CLR world comparing one null reference to another null reference is determined to return "true" (https://github.com/dotnet/csharplang/blob/master/spec/types.md#the-bool-type).

In the C and C++ languages, a zero integral or floating-point value, or a null pointer can be converted to the boolean value false, and a non-zero integral or floating-point value, or a non-null pointer can be converted to the boolean value true. In C#, such conversions are accomplished by explicitly comparing an integral or floating-point value to zero, or by explicitly comparing an object reference to null.

from succinct.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.