Git Product home page Git Product logo

Comments (2)

fluentfuture avatar fluentfuture commented on May 5, 2024

Thanks for the interest in the library!

One design goal of this library is to avoid forcing users to explicitly go through any semantic-anemic types.

While Map.Entry isn't that bad, it has setValue(), which makes it mutable.

Instead, my opinionated objective is to have the users map() to their own type at the proper abstraction layer, rather than having to go through some "generic" type as the middle-man.

For example: biStream.map(MyOwnType::new).findFirst().

That said, you may not have a MyOwnType and Map.Entry could be good enough sometimes. I vaguely recall once considering something along this line, but then figured that it should be easy enough for the user to do:

biStream.map(AbstractMap.SimpleEntry<K, V>::new).findFirst()

I don't remember if that <K, V> is necessary or the compiler is able to infer.

Let me know if this works for you?

from mug.

andrewparmet avatar andrewparmet commented on May 5, 2024

Ironically enough I just tried to work through that in my own code and got hung up at setValue() myself - and proceeded to roll my own type. It works nicely. Thanks!

from mug.

Related Issues (17)

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.