functional-java

How safe would it be to use functional-java to add closures to a Java production project?

假装没事ソ 提交于 2019-12-22 05:13:15
问题 I would love to use closures in Java. I have read that they may or may not make it into Java 7. But an open-source project called functional-java has implemented functional features including closures. How safe would it be to use such a library in an enterprise production app? Is there a better way to add closures to Java currently? 回答1: Closures will definitely not make it into Java 7, due to a lack of consensus around a single implementation. See here. The Functional Java library is

Mapping a FunctionalJava Option<Type> with Hibernate

柔情痞子 提交于 2019-12-18 05:59:10
问题 I have a hibernate-mapped Java object, JKL , which is full of a bunch of normal hibernate-mappable fields (like strings and integers). I'm added a new embedded field to it (which lives in the same table -- not a mapping), asdf , which is a fj.data.Option<ASDF> . I've made it an option to make it clear that this field may not actually contain anything (as opposed to having to handle null every time I access it). How do I set up the mapping in my JKL.hbm.xml file? I'd like hibernate to

How safe would it be to use functional-java to add closures to a Java production project?

三世轮回 提交于 2019-12-05 07:23:35
I would love to use closures in Java. I have read that they may or may not make it into Java 7. But an open-source project called functional-java has implemented functional features including closures. How safe would it be to use such a library in an enterprise production app? Is there a better way to add closures to Java currently? Closures will definitely not make it into Java 7, due to a lack of consensus around a single implementation. See here. The Functional Java library is thoroughly tested and actively developed. If you browse the source you will see that it's just simple bog-standard

Anything in Guava similar to Functional Java's Effect?

回眸只為那壹抹淺笑 提交于 2019-11-30 15:45:35
问题 I know one of the goals of pure functional programming is to eliminate mutability, and therefore to preclude side-effects. But let's face it, Java is not a functional language even with all of the functional-programming libraries that exist. In fact it seems that some of the FP-libraries know and expect this. For instance in Functional Java, there is the Effect class. In the Jedi FP library, there is the Command interface. This allows you to -- among other things -- apply a command pattern

Is there a good comparison between Functional Java and Guava?

谁说胖子不能爱 提交于 2019-11-30 08:52:56
I'd like to use either Functional Java or Guava (or less likely Scala) in a course I'll be teaching. Although there are lots of functional languages that run on the JVM I'd like to stick to something that looks as much like Java as possible, i.e., something that will be most compatible, conceptually and syntactically, with the functional features expected in Java 8. It looks like Functional Java and Guava are the best candidates. I haven't been able to find anything comparing them in terms of capabilities, ease of use, conceptual closeness to straight Java, etc. Does anyone know of a good

Is there a good comparison between Functional Java and Guava?

橙三吉。 提交于 2019-11-29 12:01:01
问题 I'd like to use either Functional Java or Guava (or less likely Scala) in a course I'll be teaching. Although there are lots of functional languages that run on the JVM I'd like to stick to something that looks as much like Java as possible, i.e., something that will be most compatible, conceptually and syntactically, with the functional features expected in Java 8. It looks like Functional Java and Guava are the best candidates. I haven't been able to find anything comparing them in terms of

Mapping a FunctionalJava Option<Type> with Hibernate

和自甴很熟 提交于 2019-11-29 10:45:38
I have a hibernate-mapped Java object, JKL , which is full of a bunch of normal hibernate-mappable fields (like strings and integers). I'm added a new embedded field to it (which lives in the same table -- not a mapping), asdf , which is a fj.data.Option<ASDF> . I've made it an option to make it clear that this field may not actually contain anything (as opposed to having to handle null every time I access it). How do I set up the mapping in my JKL.hbm.xml file? I'd like hibernate to automatically convert a null in the database to a none of fj.data.Option<ASDF> when it retrieves the object. It