Skip main navigation

Hurry, only 2 days left to get one year of Unlimited learning for £249.99 £174.99. New subscribers only. T&Cs apply

Find out more

Summary

Summary of the key concepts covered in this activity
© University of Glasgow

The basic mechanism for computing on any datastructure in Haskell is recursion. Recursion always has a base case and an induction case. For lists, the base case is the empty list [],
the induction case is adding an element to the list x:xs

For list operations, it is usually easier
to use higher-order functions
like map (performing an operation on every element of a list)
and foldl/foldr (reducing a list to a single value). Sometimes these functions are referred to as list combinators.

© University of Glasgow
This article is from the free online

Functional Programming in Haskell: Supercharge Your Coding

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now