From 4efb34bd728732101432843ed0bfbeb971272287 Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Thu, 21 Dec 2023 14:03:41 +0000 Subject: Add chapters --- lessons/src/lesson032_records/code.gleam | 17 ----------------- lessons/src/lesson032_records/text.html | 10 ---------- 2 files changed, 27 deletions(-) delete mode 100644 lessons/src/lesson032_records/code.gleam delete mode 100644 lessons/src/lesson032_records/text.html (limited to 'lessons/src/lesson032_records') diff --git a/lessons/src/lesson032_records/code.gleam b/lessons/src/lesson032_records/code.gleam deleted file mode 100644 index bd6da3c..0000000 --- a/lessons/src/lesson032_records/code.gleam +++ /dev/null @@ -1,17 +0,0 @@ -import gleam/io - -pub type SchoolPerson { - Teacher(name: String, subject: String) - Student(String) -} - -pub fn main() { - let teacher1 = Teacher("Mr Schofield", "Physics") - let teacher2 = Teacher(name: "Miss Percy", subject: "Physics") - let student1 = Student("Koushiar") - let student2 = Student("Naomi") - let student3 = Student("Shaheer") - - let school = [teacher1, teacher2, student1, student2, student3] - io.debug(school) -} diff --git a/lessons/src/lesson032_records/text.html b/lessons/src/lesson032_records/text.html deleted file mode 100644 index f515ccd..0000000 --- a/lessons/src/lesson032_records/text.html +++ /dev/null @@ -1,10 +0,0 @@ -

Variants of a record can hold other data within them.

-

- These fields can be given labels, and like function argument labels they can - be optionally used when calling the record constructor. Typically labels will - be used for variants that define them. -

-

- It is common to have a custom type with one variant that holds data, this is - the Gleam equivalent of a struct or object in other languages. -

-- cgit v1.2.3