Tune in. Enjoy. ]]>

Simon and John have been friends for many years and studied mathematics together at Trinity College Cambridge. What were they like as young men? As students? What was Simon's issue with wearing shoes, anyway? It's always wonderful to learn about the humans behind the software, the science. This is classic C9. Yes, it's raining on us as we converse, but the view is spectacular with Sydney's Opera House behind us. It's funny how wet we were by the end of this interview, but the rain was refreshing—just like the conversation.**Thank you,** **Simon and John,** for the *great* conversation, for being so comfortable in the rain, and for taking the random questions in stride. You're true gentlemen. Keep pushing the envelope!

**Happy holidays from Channel 9** wherever you are and whatever, if anything, you're celebrating!

The **YOW! Developer Conference** offers outstanding opportunities to learn more about the latest practices, technologies, and methodologies for building innovative software solutions as well as the chance to meet and network with international software experts and other talented developers in Australia. Thanks to **Dave Thomas** and the event's *excellent* staff—**Mary Catherine (MC), Lisa, Aino, Melissa**, and others—for inviting me to this *excellent* pure developer event and thanks to all of the speakers for letting me take some of their time to record conversations for Channel 9. If you live in Australia, or aren't too far away, or just like to travel (who doesn't?), then you need to go to this yearly event. It's outstanding. There are many great developers down under. That's for sure. The speakers are exceptional—Dave and team set a high bar!

Simon works at Microsoft as a research scientist in MSR. Simon's work on Haskell is legendary and the language has seen an increase in usage over the years and a steady evolution toward being not only a general purpose, strongly-typed functional programming language, but also a practical one. No longer is Haskell suited only for academic experimentation (though this continues to be an important aspect of the language—in fact, it's one of the very effective ways the language is pushed forward). As Simon says, Haskell is like a laboratory in which to test new functional ideas and novel language constructs.

One of the very interesting aspects of Haskell is how the surface language (so, the syntax you write) is boiled down to a very small intermediate language,

How has the language evolved over the years? What's Simon working on these days (besides evolving Haskell, he's helping to make general purpose computing education for the masses

(Here's the video referenced at the beginning of this conversation.)

Simon's YOW! speaker page

Tune in. Enjoy. Learn.

The **YOW! Developer Conference** offers outstanding opportunities to learn more about the latest practices, technologies, and methodologies for building innovative software solutions as well as the chance to meet and network with international software experts and other talented developers in Australia. Thanks to **Dave Thomas** and the event's *excellent* staff - **Mary Catherine (MC), Lisa, Aino, Melissa**, and others - for inviting me to this *excellent* pure developer event and thanks to all of the speakers for letting me take some of their time to record conversations for Channel 9. If you live in Australia, or aren't too far away, or just like to travel (who doesn't?), then you need to go to this yearly event. It's outstanding. There are many great developers down under. That's for sure. The speakers are exceptional—Dave and team set a high bar!

Graham's goal here is to share technical knowledge and insights that span programming domains and skill sets—an

Enjoy. Learn!

From Dr. Hutton:

*Streams, or infinite sequences, have many applications in programming, and can naturally be defined using recursive equations. But how do we ensure that such equations make sense, i.e. that they actually produce well-defined streams? In this talk, Graham Hutton presents a new approach to this problem, based upon the topological notion of contractive functions on streams. This talk is aimed at a general audience, and doesn't require special knowledge of topology or functional programming.*

Lecture Materials:

Slides: http://www.cs.nott.ac.uk/~gmh/contractive.ppt

Paper: http://www.cs.nott.ac.uk/~gmh/contractive.pdf

Speaker Bio:

**Graham Hutton** is Professor of Computer Science at the University of Nottingham, where he co-leads the Functional Programming Lab. His research interests are in formal reasoning about program correctness and efficiency, with an emphasis on functional languages such as Haskell. He is also the author of a best-selling Haskell textbook, for which he's recorded **associated Channel 9 lectures** that have received more than 600,000 downloads.

Today's most widely used technology, by far, for static program verification is the ubiquitous type checker. Alas, static type systems inevitably exclude some good programs; and allow some bad ones. Thus motivated, Simon describes some fun he has been having with Haskell, by making the type system more expressive without losing the benefits of automatic proof and compact expression.

*About **Simon Peyton Jones*

*Simon Peyton Jones, MA, MBCS, CEng, graduated from Trinity College Cambridge in 1980. After two years in industry, he spent seven years as a lecturer at University College London, and nine years as a professor at Glasgow University, before moving to Microsoft Research (Cambridge) in 1998. *

*His main research interest is in functional programming languages, their implementation, and their application. He has led a succession of research projects focused around the design and implementation of production-quality functional-language systems for both uniprocessors and parallel machines. He was a key contributor to the design of the now-standard functional language Haskell, and is the lead designer of the widely-used Glasgow Haskell Compiler (GHC). He has written two textbooks about the implementation of functional languages. *

More generally, he is interested in language design, rich type systems, software component architectures, compiler technology, code generation, runtime systems, virtual machines, and garbage collection. He is particularly motivated by direct use of principled theory to practical language design and implementation -- that's one reason he loves functional programming so much. His home page is at

]]>Haskell is now quite widely used, but its most important contributions are the ideas that it embodies. In this talk Simon focuses on one of these ideas, namely type classes, with a few anecdotes and reflections along the way about the process of developing the language.

Type classes are probably Haskell's most distinctive feature. The original idea is very neat and, better still, it led to a long series of subsequent generalizations and innovations. Indeed, although the language is now nineteen years old, Haskell's type system is still in a state of furious development. For example, Simon is involved in adding type-level functions to Haskell, as he briefly describes.

Simon explains what type classes are, how they differ from the classes of mainstream object oriented languages, why he thinks they are so cool, and what the hot topics are.

*About **Simon Peyton Jones*

*Simon Peyton Jones, MA, MBCS, CEng, graduated from Trinity College Cambridge in 1980. After two years in industry, he spent seven years as a lecturer at University College London, and nine years as a professor at Glasgow University, before moving to Microsoft Research (Cambridge) in 1998. *

*His main research interest is in functional programming languages, their implementation, and their application. He has led a succession of research projects focused around the design and implementation of production-quality functional-language systems for both uniprocessors and parallel machines. He was a key contributor to the design of the now-standard functional language Haskell, and is the lead designer of the widely-used Glasgow Haskell Compiler (GHC). He has written two textbooks about the implementation of functional languages. *

More generally, he is interested in language design, rich type systems, software component architectures, compiler technology, code generation, runtime systems, virtual machines, and garbage collection. He is particularly motivated by direct use of principled theory to practical language design and implementation -- that's one reason he loves functional programming so much.

His home page is at

Why *bananas*, Ralf?

*Banana *is functional programming slang for "fold"—an application of the catamorphic recursion scheme most widely known in the higher-order list processing tradition of Bird-Meertens Formalism and the Squiggol community. Erik Meijer used to be known as the "banana man" because of his early research on the subject; he also co-authored the seminal paper with theoretical (categorical) foundations on the subject. Incidentally, the paper used the notation of so-called "banana brackets" (instead of using the plain string "foldr"), which sort of explains why we sometimes say bananas. There is no shortage of crazy paper titles on the subject, by the way: "Functional Programming with Bananas, Lenses, Envelopes, and Barbed Wire," "Bananas in Space: ...," "Dealing with large bananas," "Boxes go bananas: ...," "See more through lenses than bananas," etc.

More to the point, ** foldr** is the Swiss Army Knife in functional programming. Monoidal reductions of lists or mapping over lists and many other list-processing idioms can be modeled with the regular recursion operator

**Learn more:Going Bananas lecture slide deck**

Ralf's blog

For the exercises/riddles in the slide deck:

12 (medium)

18 (medium)

21 (medium)

23 (easy)

24 (hard)

31 (hard)

34 (easy)

Today, Ralf Lämmel's lecture goes back to the roots, essentially revisiting Wadler's "The essence of functional programming"—the 1992 paper that discovered monads and popularized their use in functional programming. Ralf Lämmel's lecture and accompanying code distribution show Wadler's seminal insight: those original scenarios and observations still make sense today. Indeed, Simon Marlow (a Haskell/GHC high priest @ MSR Cambridge) recently noted: "it's still the best monad tutorial" (see http://twitter.com/simonmar/status/21397398061).

Focusing on a few generically useful monads, Dr. Lämmel explains how the work within the interpretation domain. While the lecture also takes a look at the contemporary Haskell library for monads and monad transformers, there are obviously many monads and associated domains that cannot be covered this time. If you want to learn more about monads, then continue with state threads, IO, parsing, and concurrency (STM).

Slide deck:

Exercises/riddles:

Slide #4 (easy), #6 (modest), #13 (modest), #40 (hard)

Code distribution:

Blog post:

http://professor-fish.blogspot.com/2010/09/essence-of-essence-of-functional.html

]]>More specifically, this lecture develops an interpreter for a simple functional programming language that contains Booleans, natural numbers, lambdas, and recursive lets. The interpreter is actually developed in a stepwise manner, which is why the lecture
is called "Evolution of an Interpreter."

In each step, another construct is added and the impact of the extension onto the interpreter is analyzed. In this manner, several interesting programming techniques are exercised. For instance, the Maybe type constructor is pervasively used for dealing with
partiality, and Haskell's fixed point combinator is used to model the semantics (i.e., interpretation) of recursive bindings.

This lecture also prepares us for some more advanced subjects. For instance, the next lecture in this series will cover the intriguing subject of monads while using interpretation as the application scenario. Soon, generalized folds (or
bananas, according to Erik Meijer) will also be discussed (the folds will traverse abstract syntax trees as opposed to lists).

Enjoy. Learn.

Thanks to Ralf for providing another *excellent* lecture!

Earlier lectures
**here**.

Related Blog Post and Code:

http://professor-fish.blogspot.com/2010/08/bunch-of-interpreters-using-cpp-and.html

]]>Welcome to another series of C9 Lectures covering functional programming. For this series, Dr. Ralf Lämmel has generously taken the time to produce videos for Channel 9 from his office at the University of Koblenz-Landau (Germany), where he is a professor of computer science. The idea here is to take the next step from Erik Meijer's fantastic introductory series on functional programming. Accordingly, Ralf's series will dive into more advanced areas of functional programming, again focusing on the Haskell language (the functional concepts here span beyond any one functional language, however).

To begin, Dr. Lämmel teaches us about the Expression Problem. Now put on your thinking caps, make yourself comfortable, and enjoy this installment of functional programming lectures on Channel 9. Huge thanks to Dr. Lämmel, both for doing this series for Channel 9 and for filming and producing it all by himself! Finally, thanks to Erik Meijer for suggesting this series and putting me in touch with Ralf.

See Dr. Lämmel's blog post about the new lecture series here: http://professor-fish.blogspot.com/2010/08/lecture-series-on-advanced-functional.html

[Homework assignment is on slide 26 -

Programming in Haskell. Of course, Erik merged his own extensive knowledge, unique perspective and experience into the educational weave: so, you got the best of two worlds. We hope you enjoyed this series, the first in a new a format of Channel 9 content (lectures).

The Channel 9 team and Niner nation thank our dear friend Erik for this

In

In some sense, the purity inherent in functional languages like Haskell makes it easy to express and implement equational reasoning. In Haskell, our old friend "=" means "is equal to by definition". But what does equational reasoning

Tune in. Enjoy.

Chapter 5

]]>

Most programming languages that most of you use day to day use eager or strict evaluation, which is the

Tune in. Learn and enjoy!

Chapter 5

]]>

This lecture was filmed in Dr. Hutton's office at the University of Nottingham. What is the Countdown Problem, exactly? It's a numbers game, based loosely on a very popular television series. The point is that you will need to use, well, functions to solve the Countdown Problem. Of course, it goes without saying that Haskell is very well suited to solve these kinds of problems.

Tune in and learn from a Haskell master. It should be clear that you will want to have had gone through the earlier episodes (if you are beginning with functional programming and Haskell, specifically) to get the most out of this lecture. That said, it's quite amazing to learn directly from the author himself. What a nice surprise!

Enjoy!

Chapter 5

]]>

type String = [Char]

String is a synonym for the type [Char].

Like function definitions, type declarations can also have

Nested:

**type Trans = Pos -> Pos**

Illegal recursion:**type Tree = (Int,[Tree])**

A completely new type can be defined by specifying its values using a *data declaration:*

Bool is a new type, with two new values False and True.

Get the presentation slides

Chapter 5

Consider the following:

IO a

**IO Char**

You should watch these in sequence (or skip around depending on your curent level of knowledge in this domain):

Get the presentation slides

Chapter 5

]]>

be viewed as functions.

type Parser = String -> Tree

A parser is a function that takes a string and returns some form of tree.

You should watch these in sequence (or skip around depending on your curent level of knowledge in this domain):

Get the presentation slides

Chapter 5

]]>

twice :: (a -> a) -> a -> a

twice f x = f (f x)

The function twice above is higher order because it takes a function (f x) as it first argument and returns a function (f(fx))

Dr. Meijer will elaborate on why higher-order functions are important and there are some really interesting side-effects of higher-order functions such as defining DSLs as collections of higher-order functions and using algebraic properties of higher-order functions to reason about programs.

You should watch these in sequence (or skip around depending on your curent level of knowledge in this domain):

Chapter 5

For example:

factorial 0 = 1

factorial (n+1) = (n+1) * factorial n

factorial maps 0 to 1, and any other positive integer to the product of itself and the factorial of its predecessor.

Some functions, such as factorial, are simpler to define in terms of other functions. As we shall see, however, many functions can naturally be defined in terms of themselves.

Properties of functions defined using recursion can be proved using the simple but powerful mathematical technique of induction.

You should watch these in sequence (or skip around depending on your curent level of knowledge in this domain):**Chapter 1** **Chapter 2 **

Chapter 5

comprehension syntax:

[x^2 | x <- [1..5]]

The above notation represents the list [1,4,9,16,25] of all numbers x^2 such that x is an element of the list [1..5]. The <- [1..5] syntax is known as a

You should watch these in sequence (or skip around depending on your curent level of knowledge in this domain):

Chapter 5

expression e returns a type t, then e is of type t, e :: t. A function is a mapping of one type to another type and you will learn about new types of functions in this lecture, specifically curried functions: functions that return functions as a result (and

functions are values, remember) and polymorphic functions (function with a type that contains one or more type variables).

You should watch these in sequence (or skip around depending on your curent level of knowledge in this domain):

Chapter 5

]]>

functions. It's not like you're used to in mathematics like

x*y...

You should watch these in sequence (or skip around depending on your curent level of knowledge in this domain):

Chapter 5

]]>

We kick off C9 Lectures with a journey into the world of Functional Programming with functional language purist and high priest of the lambda calculus, Dr. Erik Meijer (you can thank Erik for many of the functional constructs that have shown up in languages like C# and VB.NET. When you use LINQ, thank Erik in addition to Anders).

Over the past two years, you've learned a fair amount about the functional programming paradigm's foray into general purpose imperative progamming languages (LINQ, Lambda's, etc in C# and VB.NET). And, of course, the newest language to join the Visual Studio family of languages, F#,

Dr. Erik Meijer will teach us Functional Programming Fundamentals using Haskell as the language for understanding the basic functional principles (in fact, the specific language isn't all that important, but Haskell is a pure functional language so it is entirely appropriate for learning the essential ingredients of functional programming. It is also a relatively small language and should be easy for you to get up to speed with Haskell once you understand the Why, What and How that underlies all functional languages...).

In Chapter 1, Dr. Meijer takes us through the fundamental fundamentals of functional programming: The philosophy and history of functional programming. As you can imagine, these lectures will go deeper and deeper as the chapters progress, but you need to understand the philosophical and historical contexts. This will provide a nice layer of fresh conceptual soil in which to plant the seeds of understanding the technical details of functional programming, of functional reasoning.

Welcome to C9 Lectures. Enjoy and learn, learn, learn.**ALWAYS** ask questions right here. Erik will answer them. Remember, he is professor Erik Meijer in this context and professors answer the questions of their students. Thank you, Erik, for doing this!

Welcome to C9 Lectures!

See the rest of this great series:

**Chapter 2 ****Chapter 3 ****Chapter 4 ****Chapter 5 ****Chapter 6 ****Chapter 7****Chapter 8****Chapter 9****Chapter 10****Chapter 11****Chapter 12****Chapter 13**

*This paper describes an early prototype of a parallel profiling system for multicore programming with GHC. The system comprises three parts: fast event tracing in the runtime, a Haskell library for reading the resulting trace files, and a number of tools
built on this library for presenting the information to the programmer. We focus on one tool in particular, a graphical timeline browser called ThreadScope.*

Matthew was in Redmond a few weeks ago, so we thought it would be awesome to invite Matthew into the the lair of our resident functional programming extremist (though I must say that Erik is mellowing out with age), high priest of the lamda calculus, category theorist and Expert to Expert host, Erik Meijer. Now, it's a little scary to be asked into Erik's den of functional orthodoxy (aka Erik's office) and be put to the task of explaining functional principals in a way that is widely accessible to developers who have little or no experience with

Enjoy!

Duration: 1:07:41 ]]>