FunctionalJ - a library for Functional Programming in Java

A colleague alerted me to this, which I thought might be of interest here: http://www.theserverside.com/news/thread.tss?thread_id=38430 (I have already found that my Haskell experiences have influenced my Python programming; maybe there's also hope for my Java?) #g -- Graham Klyne For email: http://www.ninebynine.org/#Contact

Graham Klyne wrote:
A colleague alerted me to this, which I thought might be of interest here:
http://www.theserverside.com/news/thread.tss?thread_id=38430
(I have already found that my Haskell experiences have influenced my Python programming; maybe there's also hope for my Java?)
I've haven't seen this before, thanks!
I wrote a similar library, Higher-Order Java (HOJ), a few years ago:
http://www.cs.chalmers.se/~bringert/hoj/
My library is less polished but seems to have more static typing. It
uses parametrized classes (as introduced in Java 1.5) to achieve this.
FunctionalJ seems to lack static typing, for example map has the type:
List map(Function p_function, List p_list)
In HOJ, it has this type:
Iterator<B> map(Fun f, Iterator extends A> xs)
In the end, I never published anything about this, since it seems too
cumbersome to use in practice. A simple lambda expressions requires a
lot of typing overhead. This function from the Pizza paper [1]:
fun boolean(char c) {
n++; return '0' <= c && c < '0' + r;
}
becomes this in HOJ:
new Fun
participants (2)
-
Bjorn Bringert
-
Graham Klyne