Have you considered using Scala? It supports functional programming on a JVM platform. You could integrate it with Java, but you might find that is not needed.
You may also find it is faster than Haskell, esp. with tighter integration with Java.
OCaml-Java is an effort to make Objective Caml available on the Java platform, currently supporting 3.11.2. The project has two concrete objectives: first, the ability to run Objective Caml sources that have been compiled using ocamlc; second, the ability to compile Objective Caml sources into executable jar files.
Using Scala or F# would be the real solutions as others say, but just in case if you like something easier to start with, you can also do some functional programming in Java (or C#) like these people https://www.google.com/search?q=functional+programming+java as FP is a programming style that favors immutability.
发布评论
评论(4)
您考虑过使用 Scala 吗?它支持 JVM 平台上的函数式编程。您可以将其与 Java 集成,但您可能会发现不需要这样做。
您可能还会发现它比 Haskell 更快,尤其是。与 Java 更紧密的集成。
http://benchmarksgame.alioth.debian.org/u64q/which -programs-are-fastest.html
Have you considered using Scala? It supports functional programming on a JVM platform. You could integrate it with Java, but you might find that is not needed.
You may also find it is faster than Haskell, esp. with tighter integration with Java.
http://benchmarksgame.alioth.debian.org/u64q/which-programs-are-fastest.html
F# 将为您提供 .Net 平台的函数式编程“自由的”。
OcamlJava 可以将 Java 与 Ocaml 交互:
F# will give you functional programming with the .Net platform for "free".
OcamlJava can interface Java with Ocaml:
您使用诸如 Scala 之类的语言,即已经在 JVM 上运行的语言。
有许多函数式语言可以在 JVM 上运行,因此可以与 Java 代码的其余部分很好地集成。
我最喜欢的是 Scala,但也有 Clojure 和 Groovy,仅举几例。
You use languages such as Scala, i.e. languages that already run on the JVM.
There are plenty functional languages that run on the JVM and thus integrate quite nicely with the rest of the java code.
My favorite is Scala, but there is also Clojure and Groovy, just to mention a few.
正如其他人所说,使用 Scala 或 F# 将是真正的解决方案,但以防万一,如果您喜欢更容易上手的东西,您也可以像这些人一样使用 Java(或 C#)进行一些函数式编程https://www.google.com/search?q=function+programming+java 因为 FP 是有利于不变性的编程风格。
Using Scala or F# would be the real solutions as others say, but just in case if you like something easier to start with, you can also do some functional programming in Java (or C#) like these people https://www.google.com/search?q=functional+programming+java as FP is a programming style that favors immutability.