This repository contains solutions to the tutorial exercises for the Informatics 1 – Functional Programming module at the University of Edinburgh. The exercises cover fundamental topics in Haskell programming, including list comprehensions, recursion, higher-order functions, logic programming, and more.
Each tutorial has a corresponding Haskell file containing solutions to the exercises. The tutorials are organized as follows:
- Tutorial 1 – List Comprehensions
- Tutorial 2 – Recursion & the Caesar Cipher
- Tutorial 3 – Higher-Order Functions
- Tutorial 4 – Screen Scraping
- Tutorial 5 – Logic and Propositional Calculus
- Tutorial 6 – Turtle Graphics and L-systems
- Tutorial 7 – Barcode Reader
- Tutorial 8 – Finite State Machines
- Clone the repository:
git clone https://github.com/mpol1t/fp-tutorials.git cd fp-tutorials - Build all tutorial modules and install the Haskell dependencies into your local Cabal store:
cabal build all
- Run the automated test suite:
cabal test - Start a REPL with all tutorial dependencies available:
cabal repl lib:fp-tutorials
- Load a specific module in GHCi:
import Tutorial8 accepts m1 "aaba"
The repository now builds as a Cabal package. The main external dependencies are:
QuickCheckvectorrandomcontainershttp-conduitOpenGLGLUT
These are installed automatically by cabal build all / cabal test.
- These solutions are for educational purposes and should be used as a reference.
- Students are encouraged to attempt the exercises independently before consulting these solutions.
- QuickCheck properties and example-based regression tests are organized under test/, and are run through
tastywithcabal test.
This repository is provided for educational purposes. Please refer to your university's academic integrity policies before using these solutions.