Git Product home page Git Product logo

domainsetscore.jl's Issues

Should there be a `Domain{T}` supertype?

cfr JuliaMath/IntervalSets.jl#170 (comment)

I'd argue the contract is different for types inheriting from Domain and types implementing the domain interface.

One difference is ownership. The DomainSets package can't provide untyped fallback definitions, even if they make sense, for functions defined elsewhere. It can define untyped fallback definitions for functions specifically defined for domains (which, currently, is typically reflected in the name of the function). In the latter case, specifying the type of an object expected to be a domain to be ::Domain can be replaced by a call to checkdomain on the argument to catch any user errors.

In general it can define fallbacks only for arguments of type DomainRef, since we own that type. By inheriting from Domain{T}, a type opts-in to such fallback behaviour, without requiring its users to sprinkle their codes with DomainRef for statements that make complete sense without.

Unless I missed some kind of mechanism, not having an optional common supertype implies DomainRef's all over the place or being restricted to functions that are used only specifically in the context of DomainSets (i.e. being less generic).

Design of the package

The package is meant to:
(i) define a Domain type that can be used as supertype of continuous sets
(ii) define an interface for domains (to make it easy for other types to behave as domains and interact with each other while being developed independently)

Any suggestions welcome!

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.