<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Functional on Micha Kops&#39; Tech Notes</title>
    <link>https://www.hascode.com/tags/functional/</link>
    <description>Recent content in Functional on Micha Kops&#39; Tech Notes</description>
    <generator>Hugo</generator>
    <language>en</language>
    <copyright>Copyright © 2010 - 2025 Micha Kops. #e9d956c0c0154a221ad83c925346a8fa0e72f866</copyright>
    <lastBuildDate>Sun, 30 Dec 2018 00:00:00 +0100</lastBuildDate>
    <atom:link href="https://www.hascode.com/tags/functional/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Next Steps to Pattern Matching in Java with Java 12 and Switch Expressions aka JEP 325</title>
      <link>https://www.hascode.com/next-steps-to-pattern-matching-in-java-with-java-12-and-switch-expressions-aka-jep-325/</link>
      <pubDate>Sun, 30 Dec 2018 00:00:00 +0100</pubDate>
      <guid>https://www.hascode.com/next-steps-to-pattern-matching-in-java-with-java-12-and-switch-expressions-aka-jep-325/</guid>
      <description>&lt;div id=&#34;preamble&#34;&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;It is interesting to see how the Java language evolves over time. One thing that I have always missed is pattern matching in a way similar to languages like Scala.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Now there are different JDK Enhancement Proposals (JEP) aiming at bringing us a little bit closer to pattern matching, especially JEP 325 aka Switch Expressions that are included in the current Java 12 preview or JEP 305 aka Pattern Matching for instanceof.&lt;/p&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <title>Using Deferred Objects and Promises with Java 8 and JDeferred</title>
      <link>https://www.hascode.com/using-deferred-objects-and-promises-with-java-8-and-jdeferred/</link>
      <pubDate>Sun, 27 Sep 2015 00:00:00 +0200</pubDate>
      <guid>https://www.hascode.com/using-deferred-objects-and-promises-with-java-8-and-jdeferred/</guid>
      <description>&lt;div id=&#34;preamble&#34;&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Promises may help us when dealing with asynchronous code and we need to merge, pipe or track the progress and the results of single parts of computation in our applications.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;In the following tutorial I’d like to demonstrate a small library, JDeferred that helps us for this specific use case.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;imageblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;img src=&#34;jdeferred-example-running-in-eclipse-ide-1024x754.png&#34; alt=&#34;jdeferred example running in eclipse ide 1024x754&#34;/&gt;
&lt;/div&gt;
&lt;div class=&#34;title&#34;&gt;Figure 1. JDeferred examples running in Eclipse IDE.&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
&lt;h2 id=&#34;_dependencies&#34;&gt;Dependencies&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Using Maven here, we simply need to add one dependency for &lt;em&gt;jdeferred-core&lt;/em&gt; to our &lt;em&gt;pom.xml&lt;/em&gt;:&lt;/p&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <title>Playing with Java 8 Lambda Expressions</title>
      <link>https://www.hascode.com/playing-with-java-8-lambda-expressions/</link>
      <pubDate>Sun, 22 Sep 2013 00:00:00 +0200</pubDate>
      <guid>https://www.hascode.com/playing-with-java-8-lambda-expressions/</guid>
      <description>&lt;div id=&#34;preamble&#34;&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Many articles have been written about JSR 335 aka &lt;em&gt;Lambda Expressions for the Java&lt;sup&gt;TM&lt;/sup&gt; Programming Language&lt;/em&gt; but I like to try new things out for myself and that’s why I’d like to share my snippets here.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;imageblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;img src=&#34;netbeans-java8-976x1024.png&#34; alt=&#34;netbeans java8 976x1024&#34;/&gt;
&lt;/div&gt;
&lt;div class=&#34;title&#34;&gt;Figure 1. Lambda Hacking using the NetBeans Developer Version&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
&lt;h2 id=&#34;_setup_jdk_and_ide&#34;&gt;Setup JDK and IDE&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;It takes just some short steps to setup your environment …&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;ulist&#34;&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;https://jdk8.java.net/lambda/&#34;&gt;Download&lt;/a&gt; and install the Java 8 JDK with lambda support&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;http://bits.netbeans.org/download/trunk/nightly/latest/&#34;&gt;Download&lt;/a&gt; and install the NetBeans IDE Development version&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure NetBeans to use the Java 8 JDK (&amp;gt; Manage Platforms…)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <title>Aspects of Functional Programming in Java</title>
      <link>https://www.hascode.com/aspects-of-functional-programming-in-java/</link>
      <pubDate>Mon, 16 Jul 2012 00:00:00 +0200</pubDate>
      <guid>https://www.hascode.com/aspects-of-functional-programming-in-java/</guid>
      <description>&lt;div id=&#34;preamble&#34;&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Functional programming is a trending topic these days and a lot of Java programmers are hot for the features that modern functional programming languages might offer.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Waiting for Java 8 and native closure support is a nice thing but for now we’re going to take a look at several Java frameworks that are trying to implement typical structures from those functional languages where possible using the capabilities of the Java language to emulate elements like higher-order-functions, closures, options and others …&lt;/p&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <title>Snippet: Mixing Scala, Java in a Maven Project</title>
      <link>https://www.hascode.com/snippet-mixing-scala-java-in-a-maven-project/</link>
      <pubDate>Fri, 23 Mar 2012 00:00:00 +0100</pubDate>
      <guid>https://www.hascode.com/snippet-mixing-scala-java-in-a-maven-project/</guid>
      <description>&lt;div id=&#34;preamble&#34;&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Having just returned from the Atlassian Camp 2012 I just toyed around with Java and Scala and wanted to share the following snippet that demonstrates how to mix code from both languages in a Maven project using the maven-scala-plugin.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
&lt;h2 id=&#34;_setting_up_the_maven_project&#34;&gt;Setting up the Maven Project&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;First create a new Maven project in your IDE or by running &lt;em&gt;mvn archetype:generate.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;In the next step, add the dependency for &lt;em&gt;scala-library&lt;/em&gt; and the scala maven repositories to your &lt;em&gt;pom.xml&lt;/em&gt; and hook the &lt;em&gt;maven-scala-plugin&lt;/em&gt; to Maven’s lifecycle. My &lt;em&gt;pom.xml&lt;/em&gt; finally looks like this one:&lt;/p&gt;
&lt;/div&gt;</description>
    </item>
  </channel>
</rss>
