Functional Programming in Java, Second Edition (Pragmatic Bookshelf)

Most Active This Week Top

Most Active This Month Top

Most Active This Year Top

Most Active Last Three Years Top

dtonhofer
Just some thoughts on being hard on exceptions in functional languages. On p. 167 we read: Functional style code is amazing, concise, ...
New
dtonhofer
As for FinanceData on page 91, the code for AirportInfo uses the suspect and soon-to-be-deprecated java.net.URL. Let’s use java.net.URI i...
New
dtonhofer
It turns out that Try<T> can be ameliorated by judicious application of subclassing: no need to distinguish by actual type in the s...
New
New
dtonhofer
The filter stream operation appears on several places in Chapter 2 and Chapter 3, so it’s difficult to say where to put this, but there s...
New
dtonhofer
I have been thinking about how to collect “two adjacent elements” in a stream, for example transform a stream of Long into a stream of Pa...
New
New
dtonhofer
We read: We are using the amazing feature of the switch expression of Java [Java 12]. If you’re using an older version of Java, you may...
New
dtonhofer
A question to highlight is: Is there a way to make sure that a stream is NOT parallel, and make this evident in the code? As in: strea...
New
dtonhofer
As traditional , the “impure” code of page 207 in the form of a pretend test. (Doesn’t “impure” refer to performing uncontrolled side ef...
New
dtonhofer
Although now aged by 34 years: “The Conception, Evolution, and Application of Functional Programming Languages” by Paul Hudak (1989-09-...
New
New
New
New
New

Most Active Over Three Years Top

New
New
dtonhofer
The example on page 125 comes closest to the mythical “self-modifying code” (a completely useless concept as modifying the data structure...
New
dtonhofer
We read: public static void betterWay() { List<File> files = Stream.of(new File(".").listFiles()) .flatMap(file ...
New
dtonhofer
Again, some code suggestions for “Chapter 4”, similar to “Chapter 3” (one would wish to have better markdown syntax highlighting to make...
New
dtonhofer
Suggesting a text change: We read: We’ve registered a WatchService to observe any change to the current directory. but what actually...
New
New
dtonhofer
On page 103, the code for FluentMailer provides a static method which is basically a service that (opaquely) instantiates a FluentMailer,...
New
dtonhofer
In Chapter 9, p.164 the stream is parallelized in 1 step. This inspired my to write some test some code to call a task “in parallel”: ...
New
dtonhofer
On page 55, we see Compare.java final Function<Person, String> byName = person -> person.getName(); people.stream() .sorted(...
New
dtonhofer
This is no particular interest but here is some code that uses the “execute around” pattern to build a timer to time the “primes generato...
New
dtonhofer
On page 15, we read: In this example we’re sending a function, price -> price * 0.9, as an argument to mapToDouble The function bein...
New
dtonhofer
I suggest this nicer code for the Statistics.java on page on page 70 (we are doing streams after). Not using a main() but a JUnit 5 Test...
New
New
New

Get money off!

The Pragmatic Bookshelf

35% off any eBook

Simply use coupon code "devtalk.com" at checkout. See full details here.

Latest

View all Functional Programming in Java, Second Edition threads ❯