All programmers know that different data types can have common attributes. Apples and oranges may not be comparable, but they both have weight, can be peeled, and so on. And if you had a basket of fruit you might want to count the fruit or sort items by weight. Even though the basket could be full of apples, oranges or even bananas, the same operations apply.
This month's lecture covers parametric polymorphism and type classes. We will see how parametricity provides strong guarantees about the behaviour of a function, and how type classes can be used to define functions that apply to disparate types. Type classes will be compared to classes in other languages, and we will meet some of Haskell's common type classes and learn how to use them with our types, as well as how to define new type classes.
Java 8 has introduced a lot of new functionality, including Lambda Abstractions and a lot of associated changes. In this talk John Gough will discuss the use and implementation of Lambdas and the other, helper changes. The introduction of Lambdas in Java-8 is viewed from the perspective of programming language evolution and is compared and contrasted with similar functionality in other modern languages.
Bio: John Gough has been implementing programming languages of various kinds for about 30 years. He was designer of the Gardens Point family of compilers, chiefly targeting Pascal-Family languages. He was a pioneer of the art of implementing languages other than Java on the Java Virtual Machine, and still maintains compilers targeting both the JVM and the .NET Common Language Runtime. His books include Syntax Analysis and Software Tools, Addison-Wesley 1988 and Compiling for the .NET Common Language Runtime, Prentice-Hall 2002. John was previously Dean of Information Technology at QUT, and now works at Oracle Labs in Brisbane.
Java 8 for Functional Programmers by James Livingston
Java 8 introduced several new features which will make applying functional programming principals in Java simpler, easier and more concise.
Beginning with an overview of Lambdas and the Streams library, we will then look at how they can be used to improve the quality of Java code. We will discuss the good parts, the parts that don't live up to what we would like, and what it may mean in future for Java and the FP world.
A basic knowledge of Java and functional programming concepts is assumed, but you don't have to be an expert at either.
So far we have explored data types, pattern matching, and recursive functions in our quest to achieve functional enlightenment, but singular functions alone are lonely things. If only we could assemble a number of functions together to form a super function...
This month we explore methods to compose functions together, through currying and partial application, treating them as Higher-Order functions, and eventually exploring folds. Through this we can reduce the complexity and amount of code we write in common patterns by combining pre-made implementations with application-specific code.
This talk will begin with a pragmatic introduction to free monads, covering how to create them, how to make use of them, and why they're useful.
The rest of the talk will cover how and why they work, along with some useful related ideas. This will be interspersed with shallow but energetic dives into the more theoretical parts of Haskell, to help build intuition for what is going on behind the scenes.
The theoretical sidebars aren't just to dazzle, delight and amaze - they will also help to show how a handful of theoretical concepts can be combined into something of incredible practical use.