Giter VIP home page Giter VIP logo

Comments (6)

dzmitry-lahoda avatar dzmitry-lahoda commented on July 18, 2024

Would Opt be replaced

public struct Opt<T>

?
If not, could be it made more Union based Option Like API?
If could not, could why be document in remarks when to use that or that.

Update:
Opt is similar to Nullable.

from imtools.

dzmitry-lahoda avatar dzmitry-lahoda commented on July 18, 2024

C# interfaces with implementations may help to eliminate

           public bool Equals(Case1 other) => EqualityComparer<T1>.Default.Equals(Value, other.Value);
            public override bool Equals(object obj) => obj is Case1 c && Equals(c);

from imtools.

dzmitry-lahoda avatar dzmitry-lahoda commented on July 18, 2024

Sum could support structs like this (no copying):

    public interface ICase<T> where T: readonly struct
    {
        ref T Value { get; }
    }

dotnet/csharplang#1620

from imtools.

dzmitry-lahoda avatar dzmitry-lahoda commented on July 18, 2024

Another optional https://github.com/AArnott/ImmutableObjectGraph/blob/24eb8b7144201b91e04ea59fcbc9e216eff8bfa5/src/ImmutableObjectGraph/Optional%601.cs

from imtools.

dzmitry-lahoda avatar dzmitry-lahoda commented on July 18, 2024

This optinal was considered http://ecma-international.org/publications/files/ECMA-TR/ECMA%20TR-089.pdf
This was done https://github.com/IllidanS4/SharpUtils/blob/master/ObjectModel/Optional.cs

I guess for either Opt or Optional:Union most these fancy API should be done.

from imtools.

dadhi avatar dadhi commented on July 18, 2024

Done, added initial version to build upon.

from imtools.

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.