Free module
Logic and functional programming
Learn logic and functional programming hands on: Prolog facts, rules and backtracking, then Haskell functions, map, filter, fold and lazy lists.
The lessons
Each lesson is free to read in full. Create a free account to run its commands in a live lab and to sit its quizzes and tasks.
1 · Container lab
Facts and queries in Prolog
I can state facts and ask Prolog a question about them.
Read the lesson2 · Container lab
Rules and recursion in Prolog
I can write a rule that uses other facts, including a rule that uses itself.
Read the lesson3 · Container lab
Lists and backtracking in Prolog
I can explain how Prolog searches for answers and backtracks to try another.
Read the lesson4 · Container lab
Haskell functions and types
I can read a small Haskell function and say what its type means.
Read the lesson5 · Container lab
Map, filter and fold
I can replace a loop over a list with map, filter or fold.
Read the lesson6 · Container lab
Recursion and lazy evaluation
I can write a recursive function and say why an infinite list can still be used.
Read the lesson
Worked in a real lab
Every lesson of this module is worked in a lab started for you alone. The labs it uses:
Teaching a class? Set this module for your students with a teacher guide, marked assignments and a lab for every student.