Skip to content

mpol1t/fp-tutorials

Repository files navigation

Functional Programming Tutorial Solutions

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.

Structure

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

Getting Started

  1. Clone the repository:
    git clone https://github.com/mpol1t/fp-tutorials.git
    cd fp-tutorials
  2. Build all tutorial modules and install the Haskell dependencies into your local Cabal store:
    cabal build all
  3. Run the automated test suite:
    cabal test
  4. Start a REPL with all tutorial dependencies available:
    cabal repl lib:fp-tutorials
  5. Load a specific module in GHCi:
    import Tutorial8
    accepts m1 "aaba"

Dependencies

The repository now builds as a Cabal package. The main external dependencies are:

  • QuickCheck
  • vector
  • random
  • containers
  • http-conduit
  • OpenGL
  • GLUT

These are installed automatically by cabal build all / cabal test.

Notes

  • 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 tasty with cabal test.

License

This repository is provided for educational purposes. Please refer to your university's academic integrity policies before using these solutions.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors