Comments (5)
Why would anyone use standard java collections? What is the use-case for such a thing?
from functionaljava.
Given a real world project with a modestly big codebase there are tons of usages of standard java collections. It's not easy to turn them all in fj structures in one step. And even if it is possible there are certain APIs with standard collections usage that cannot be changed but should be implemented. So I wish FJ were more friendly in its naming.
from functionaljava.
Yeah, standard java collections are mutable, therefore impractical. Many
of us come to fj realising this and trying to improve things. So, fj
code will mix with java collections frequently.
I don't use fj in my main project, but have developed a very similar
library. List is the big one. We called it ConsList. I've also used a
prefix of Im for Immutable in other structures.
I fully understand your pain, but I really don't think it's practical to
rename classes in fj. It would break pretty much all fj users.
That leaves a few options:
- In your code, try and only use either java.util collections or fj
collections within the one class. - Qualified imports. Pick which will be qualified (fj or java.util) and
try to be consistent throughout your project. - Tweak your IDE settings so that fj collections will be imported, but
java.util ones won't - Push hard to refactor your code to the fj collections.
- Fork fj.
If only java had type aliases - you could import a module of aliases and
use those names instead.
from functionaljava.
@techtangents Thank you for your advice. Refactoring all the things seems too hard for me. Also it would not be nice to bother my team with additional restrictions. I'd rather fork fj.
from functionaljava.
Unfortunately the names class with the Java standard library. This puts up artificial barriers to using the library for new users.
Personally, I'd like to rename all the classes that clash (in particular List, Set, Stream, HashMap, HashSet, TreeMap, Writer, Class) but I don't think we should force people using the library to handle the change.
I am supportive of a fork or branch that does this, but fear that it won't be maintained.
from functionaljava.
Related Issues (20)
- Add fj.test.Gen.sequence(Validation<E, Gen<A>>). HOT 1
- Add sequence* and traverse* functions to Validation; add sequence* functions to Option.
- Several fj.data.Validation.accumulate functions construct unexpected or incorrect failures.
- Add fj.data.Seq.bind(F<A, Seq<B>>)
- Add fj.data.List.sequence* functions, some fj.data.List.traverse* functions.
- Add fj.data.Seq.sequence*, fj.data.Seq.traverse* functions.
- Add fj.data.Either.leftMap, rightMap.
- Will there be a release 4.8.2 / 4.9? HOT 9
- Add fj.data.State.bind(F<A, State<S, B>>).
- Add fj.data.Stream.sequence*, fj.data.Stream.traverse* functions.
- Add fj.data.NonEmptyList.sequence*, traverse*, foldLeftN, foldRightN, init, last.
- Performance: Append operation of List and Array HOT 6
- build HOT 6
- How to create a Traversal for a List of arbitrary length HOT 1
- Remove POptional/Optional optics
- lens, traverse and validate question
- Test Smell: it is not a good practice to write a return statement in test cases HOT 2
- Generated pom dependencies inconsistent with gradle build HOT 2
- Website down? HOT 3
- Is it possible to upgrade the Gradle version used to build the project?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from functionaljava.