Skip to content

Haskell-like functional utils for Java 8, mainly data structures.

License

Notifications You must be signed in to change notification settings

josefplch/java-utils

Repository files navigation

Haskell-like functional utils for Java

  • tuples
  • lists
  • sets
  • trees
  • and more

Sample use

Code:

System.out.println (
    StringList.split (' ', "a quick brown fox jumped over the lazy dog")
    .mapToPair (s -> Pair.of (s.length (), s))
    .sortBy (Pair.LexicographicalComparator.natural ())
    .groupByKey (Pair :: get1)
    .mapToString (group -> group.head ().get1 () + ": " + group.mapToString (Pair :: get2).join (", "))
    .unlines ()
);

Output:

1: a
3: dog, fox, the
4: lazy, over
5: brown, quick
6: jumped

About

Haskell-like functional utils for Java 8, mainly data structures.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages