Coder Social home page Coder Social logo

Comments (2)

geoah avatar geoah commented on June 3, 2024

This is an interesting approach but Iā€™m not sure how it would look in real life.

The method signatures would still return K/T specifically unless you want to make Edge() for example accept interface{} which would be kinda missing the point.

I might be missing something here.

ps. What happens to the methods that will come out of 25 that will have to use the graph in this case?
ā€”-

Alternative would be having a different constructor? NewByValues(ā€¦) GraphByValues that has a different interface and basically is a wrapper for Graph (and also extends it)?

from graph.

dominikbraun avatar dominikbraun commented on June 3, 2024

So I played around quite a bit and tried to solve this by using two versions of inEdges and outEdges for storing the edges, one that stores Edge[T] and one that stores Edge[K] - and I really don't like it so far. Especially with the new Store interface in place, this will get confusing.

This would be the only way that would be ok for me, but of course, this doesn't work because of the type parameters: https://go.dev/play/p/Zi0H2EUNHa6

I agree that a wrapper type would be the cleanest way to solve this, if any. But I'd like to wait at least for #12 and #25, so I'm going to close this issue and create a new one once we exactly know what we're needing.

from graph.

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.