Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 860031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:45:29+00:00 2026-05-15T08:45:29+00:00

This is very similar to another question ( Functional Data Structures in Java )

  • 0

This is very similar to another question (Functional Data Structures in Java) but the answers there are not particularly useful.

I need to use immutable versions of the standard Java collections (e.g. HashMap / TreeMap / ArrayList / LinkedList / HashSet / TreeSet). By “immutable” I mean immutable in the functional sense (e.g. purely functional data structures), where updating operations on the data structure do not change the original data, but instead return a new instance of the same kind of data structure. Also typically new and old instances of the data structure will share immutable data to be efficient in time and space.

From what I can tell my options include:

  • Functional Java
  • Scala
  • Clojure

but I’m not sure whether any of these are particularly appealing to me. I have a few requirements/desirements:

  • the collections in question should be usable directly in Java (with the appropriate libraries in the classpath). FJ would work for me; I’m not sure if I can use Scala’s or Clojure’s data structures in Java w/o having to use the compilers/interpreters from those languages and w/o having to write Scala or Clojure code.

  • Core operations on lists/maps/sets should be possible w/o having to create function objects with confusing syntaxes (FJ looks slightly iffy)

  • They should be efficient in time and space. I’m looking for a library which ideally has done some performance testing. FJ’s TreeMap is based on a red-black tree, not sure how that rates.

  • Documentation / tutorials should be good enough so someone can get started quickly using the data structures. FJ fails on that front.

Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T08:45:29+00:00Added an answer on May 15, 2026 at 8:45 am

    It seems to me you already know what your options are, you just aren’t happy with any of them. Here is my take on the three choices you’ve provided:

    Functional Java – This one seems like the best fit for you. It fits all of your requirements except that you don’t like the documentation. From my perspective the documentation looks basic, but serviceable. Their code snippets should get you up and running quickly. The learning curve seems almost non-existent which should help mitigate the lack of documentation. FYI, core Java’s TreeMap is based on a Red-Black tree as well.

    Scala – This is the choice I would make if I was in your shoes. You seem to not want to learn a new language, but Scala is a very easy transition from Java. You can write very java-like code at first, and slowly adopt more functional idioms. The Java <-> Scala interop is excellent in both directions as well.

    Clojure – As much as I love Clojure, its tough to recommend in this particular instance due to the radically different syntax and steep learning curve for a java developer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This post is very similar to my previous one, but the data structures are
I know there is this question that is very similar, but I wanted to
There is a question very similar to this but I wanted to ask it
This is very similar to another recent question: How can I return the current
This may not seem like a development question but there is a link. I
this question is very similar to another post I basically want to use the
I posted another question on a very similar topic, but turned out to be
Sorry if my last question is very similar, but I have another query of
This question is very similar to use preg_split instead of split but I've got
I know that there's a very similar topic for this question, however I'm trying

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.