All Questions
Tagged with functional-programming java
36 questions
5
votes
1
answer
563
views
FRP-style GUIs in Java
I recently built a small web application using riotjs, a library that facilitates creating UIs in the spirit of functional reactive programming, i.e. defining the UI as a pure function of the ...
116
votes
3
answers
114k
views
What is the name of a function that takes no argument and returns nothing? [closed]
In Java 8's java.util.function package, we have:
Function: Takes one argument, produces one result.
Consumer: Takes one argument, produces nothing.
Supplier: Takes no argument, produces one result.
.....
1
vote
2
answers
475
views
In what language does a method not return a value and a function does?
I don't know from where I got this but in my head a function returns a value and a method does not.
I know that with OOP a method is a function related to a class. But I am trying to remember where I ...
14
votes
1
answer
2k
views
Reasons for removal of function types in Java 8
I have been trying to understand why the JDK 8 Lambda Expert Group (EG) decided not to include a new function type into the Java programming language.
Going over the mailing list I found a thread with ...
16
votes
10
answers
7k
views
Are immutable objects important only in multi-threaded applications and if so, how are shared immutable objects useful?
I think the answer to the first part of my question is, "yes" -- no point in making objects immutable in a single-threaded application (or I guess in a multi-threaded application if that ...
52
votes
7
answers
24k
views
Workaround for Java checked exceptions
I appreciate a lot the new Java 8 features about lambdas and default methods interfaces. Yet, I still get bored with checked exceptions. For instance, if I just want to list all the visible fields of ...
1
vote
1
answer
355
views
Is designing a generic parameterized class with methods of it accepting higher order functions a functional technique that we can use in Java 8?
Recently I have asked this question: How do you rewrite the code which using generics and functionals in Java 8 and mixing oop and functional programming by using only object-oriented? on ...
5
votes
3
answers
3k
views
Significant difference between functional and procedural collection handling [closed]
I'm planning an empirical study on function passing - specifically lambdas aka anonymous functions aka arrow functions. Now, although functional or even object-oriented approaches are highly favored ...
-2
votes
3
answers
525
views
Do functions make Java a functional programming language? [closed]
I have been struggling to understand programming paradigms.
OOP is a paradigm with sole aim of modeling complex (real-world) systems, and it got me thinking:
is OOP the only programming paradigm ...
-1
votes
1
answer
112
views
Which programming paradigm mixes well with reactive in java? [closed]
So I have the feeling that one can forget object oriented programming when reactive streams are in use, due to the lack of the async-await syntax (because with the call chaining, the state has to be ...
3
votes
2
answers
3k
views
Java 8 - When should I use java.util.Stream instead of java.util.Collection?
I started studying functional programming with JavaScript. After this, I started to study it with Java 8 (streams, lambdas and method reference) and I realised that I tend to use streams as much as ...
0
votes
4
answers
229
views
Is there a mismatch between XSL and OOP? [closed]
context and background:
I prefer OOP for the most part and find it, largely, more intuitive -- this is my bias.
When I read that functional language x is better than OOP language y I think to myself:...
2
votes
3
answers
3k
views
Is it allowed to throw a runtime exception from a java.util.Predicate
The java.util.Predicate interface contains the test(...) method, whose JavaDoc description states that it [evaluates] this predicate on the given argument and that it [returns] true if the input ...
6
votes
3
answers
3k
views
Does reflection in Java make its functions "first class"
I am always hearing people talk about how Java does not support first class functions, that it is an advantage you get from functional languages, the only way to simulate it in Java is through the use ...
0
votes
1
answer
530
views
java.util.function.Function as an interface for an mutable object
I have an interface with only a single method that could be replaced by java.util.function.Function from the JDK:
interface DataModel {
boolean apply(Map<String, Integer> input);
}
The ...