r/java • • Sep 25 '19

I made an expansion of the java.util.function package to support more functional programming concepts

Hi everyone. I made this because I've always had an interest in functional programming and always wished this package could do just a little bit more (without necessarily becoming some giant fully-featured functional-programming library). Here's the repo: https://gitlab.com/Eolu/funcyjava

This really started because I wanted to do functional partial applications, and occasionally wanted to call `map` on a bare Function object that wasn't necessarily part of a stream. I basically did a rewrite of java.util.function (while extending the classes there while possible to preserve compatibility). There's a nice little readme explaining just what's in here.

Basically I've been wanting to share this with people to see if anyone finds it useful/interesting, and this seemed like a good subreddit. Any comments/questions/criticism/ideas/etc will be appreciated!

13 Upvotes

3 comments sorted by

5

u/tofiffe Sep 26 '19

Interesting, but I suggest you ad a license if you want people to use it, also publishing on maven for example couldn't hurt!

1

u/Eolu Sep 26 '19

I added the MIT license. I haven't used maven or maven central before, but I'll take a look into that too!

1

u/chabala Oct 02 '19

Looks like most of this was cut and pasted from Oracle's source code as the starting point, given that the copyright headers are still intact. That might be legal, it is GPL 2.0 after all, but it is ... unusual ... as a technique for writing a library, and likely means your additions are bound by GPL 2.0 as well.

Learning maven will be important to getting your library to central, and there are a lot of conventions you need to conform with, like using a package that relates to a domain you control, rather than just 'eolu'. For something like this, I'd expect to see a lot of unit tests in your project as well.