GoingDeep: C9 Lectures: Dr. Erik Meijer - Functional Programming Fundamentals Chapter 10 of 13

GoingDeep

We've kicked 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 L.

Running time
0h44m
File size
20.00MB

Download Original File | View original post

Episode synopsis

We've kicked 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).

We will release a new chapter in this series every Thursday.

In Chapter 10, Declaring Types and Classes, Dr. Meijer teaches us about type declarations, data declarations, arithmetic expressions, etc.  In Haskell, a new name for an existing type can be defined using a type declaration:

 type String = [Char]

 String is a synonym for the type [Char].

Like function definitions, type declarations can also have parameters. Type declarations can be nested, but not recursive.

Nested:
type Pos   = (Int,Int)

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:

 
data Bool = False | True

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


Get the presentation slides here

Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 9

You might also like...

Comments

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“We better hurry up and start coding, there are going to be a lot of bugs to fix.”