Introduction toHaskell – Spring 2013 Course Description Introduces basic concepts of functional programmingthrough the use of Haskell, a powerful language rapidly gaining popularity among both industry and research. Topics include , type- classes, higher-order functions, list comprehension, , lambda calculus, functors, and monads. Emphasizes thinking functionally as opposed to imperatively. Prerequisites An introductory Computer Science course is recommend but not required. No previous Computer Science knowledge will be assumed. Course Instructor For class related questions, comments, or concerns, contact the course instructor. Nishant Shukla – 3rd year Computer Science/Mathematics major whose interests include , artificial intelligence, and Android. Office:--- Email: [email protected] Professor of Contact If a student has a significant issue with the course, grades, or instructor, contact the course professor. Jack W. Davidson – CS Professor at UVa whose research includes compilers, programming languages, computer architecture, embedded systems, and computer security. Office: Rice 426 Email: [email protected] Textbooks 1. Real World Haskell by Bryan O'Sullivan, Don Stewart, and John Goerzen (Available online: http://book.realworldhaskell.org/ ) 2. Learn You a Haskell for Great Good! By Miran Lipovača (Available online: http://learnyouahaskell.com/ ) Grading Policy 40 points – Attendance: 5 points are earned for each class attended (up to 40 points max) 30 points – Homework: Each homework assignment will be uploaded to the class website and graded in a 0-3 scale. Coding assignments will be scored with an automated grading system. 30 points – Final project: Write a piece of Haskell code that contains 12 out of 20 listed Haskell features. The list of features will be discussed and handed-out in class.

Weekly Schedule Week 1  What is functional programming?  Why functional? And why Haskell?  Discuss the history of functional programming

Homework:

 Set up your dev environment by installing the Haskell platform http://www.haskell.org/platform/ Week 2  Understand how to run Haskell code  Introduce the Glasgow Haskell Compiler (GHC)  Use GHCi as a calculator  Introduce the concept of Lists, Tuples, and Lazy evaluation

Homework:

 Write two different implementations of a factorial function

Week 3  Introduce Pattern matching  Introduce Guards  Introduce Lambda Calculus

Homework:

 Write a BMI calculator using guards or pattern matching Week 4  Introduce Types and Typeclasses  Discuss the importance of strongly typed languages such as Haskell  Learn how to create your own Data Type (example: Tree data structure)

Homework:

 Write a generalized Caesar Cipher with the following Type definition :: Int- > [Char] Week 5  Relate Caesar Cipher homework problem to the functional programming philosophy  Why doesn’t Haskell support for-loops or while-loops?  Focus on importance and usage of Folds, Maps, and Filters

Homework:

 Research 5 facts about Monads Week 6  Introduce input and output, and the idea of side-effects  Introduce the concept of a monad  Further explore higher-order functions such as Maps and Filters

Homework:

 Write a password strength checker using the IO Monad Week 7  Demonstrate importing useful Haskell modules and third-party packages  Introduce Cabal

Homework:

 Use an existing package to implement where on a plane two lines intersect Week 8  Introduce Functors  Introduce Monoids

Homework:

 Write a Tree data structure in terms of Functors Week 9  Deeply explore importance of Monads  Create our own Monad  Understand the ‘do notation’  Go over final project instructions

Homework:

 Think about project ideas Week 10  Share and analyze project ideas

Homework:

 Continue working on final project Week 11  Present final project

Homework:

 None Week 12  Introduce Category Theory, the mathematical inspiration behind Haskell