From eee300eb33d960e3ccb7da3f30ff6941f7d19821 Mon Sep 17 00:00:00 2001 From: Joel Kaasinen Date: Fri, 26 Sep 2025 08:59:31 +0300 Subject: [PATCH] lecture 1: fix formula for area of circle closes #99 --- part1.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/part1.html b/part1.html index af7676f..ac48ce6 100644 --- a/part1.html +++ b/part1.html @@ -241,7 +241,7 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni

Pattern matching – defining functions based on cases that correspond to your data definitions:

area Point = 0
 area (Rectangle width height) = width * height
-area (Circle radius) = 2 * pi * radius * radius
+area (Circle radius) = pi * radius * radius

Lists – Unlike many languages, Haskell has a concise built-in syntax for lists. Lists can be built from other lists using list comprehensions. Here’s a snippet that generates names of even length from a set of options for first and last names:

[whole | first <- ["Eva", "Mike"],
          last <- ["Smith", "Wood", "Odd"],