2019-09-13 07:25
Page 1
Introduction to Functional Programming (TDA555, DIT440)
Welcome!
Visit the course home page for up-to-date information.
chalmers.instructure.com/courses/7316
Lectures, exercises, links to videos and course material
Programming assignments (first deadline is on Monday in week 2)
Find invitation to Slack and Fire in the announcement
Page 2
Teachers
Thomas Hallgren
Elisabet Lobo-Vesga
Sarkar Abhiroop
Jeff (Yuting Chen)
Felix Naredi
Gunnar Stenlund
Sarosh Nasir
Page 3
Student representatives
Chalmers
GU
Kevin Bäckstäde
Mirco Ghadri
Linus Sundkvist
Vera Svensson
Filip Torphage
...
...
...
...
...
Will be listed on the course home page
Page 4
Course organization
Lectures: 2 per week
Exercise sessions: 1 per week
Supervised lab sessions: 8-10 hours per week, max 26 groups at the same time
TimeEdit
Slack
Fire
Page 5
What is Functional Programming?
Programming?
program
comes from greek:
pro-
(before)
graphein
(to write / carve)
So a
program
=
instructions that are written down beforehand
to carve
means
to cut with care or precision
Functional?
We write programs by defining functions (and other things).
We mean
functions in the mathematical sense
.
Page 6
Functions
Page 7
Not a function
Page 8
Haskell
Haskell
is the
programming language
we will use in this course.
Haskell is a
general purpose programming language
(like other popular languages, e.g. C, C++, Ada, Java, Python, Go, Rust).
Haskell is a
functional programming language
(unlike most popular programming languages).
Haskell is a
high-level programming language
.
The first version of Haskell was published in 1990.
Page 9
Implementations of Haskell
The first Haskell compiler (HBC) was created here at Chalmers in 1990.
We will use GHC (the Glasgow Haskell Compiler):
An interpreter (GHCi), for easy interactive testing.
An advanced optimizing compiler, for running program efficiently.
It is installed on the computers in the labs,
It's
free
, so you can also
install it
on your own computer.
Page 10
Getting started with Haskell
Start GHCi in a terminal window
ghci
GHCi, version 8.4.4: http://www.haskell.org/ghc/ :? for help
Page 11
Live Demo
A gentle introduction to writing programs in Haskell
Source code:
Intro.hs
Page 12
Quiz
Kahoot
Page 13
Summary
We have seen
Function definitions and comments
Computations with numbers and lists
Definition by cases and recursion
Types
Property-based testing
Now you can
Try the exercises for week one (to get familiar with GHCi)
Start working on the first assignment