From 83b8df1a69dc89d85f78b36019100774b034c640 Mon Sep 17 00:00:00 2001 From: MystPi <86574651+MystPi@users.noreply.github.com> Date: Wed, 1 Nov 2023 08:06:28 -0400 Subject: [PATCH 1/2] Update introduction.md --- concepts/custom-types/introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/concepts/custom-types/introduction.md b/concepts/custom-types/introduction.md index 577e670b8..7b257c729 100644 --- a/concepts/custom-types/introduction.md +++ b/concepts/custom-types/introduction.md @@ -25,7 +25,7 @@ Creating a value for a specific case can be done by referring to its name if it ```gleam let spring = Spring -let integerTwo = SomeInt(2) +let integer_two = SomeInt(2) ``` Custom types, along with everything in Gleam, have _structural equality_, which means that two values of the same variant and with the same data are equivalent. From 7fc049034c14a40a14353a1a092251ee7a6372b1 Mon Sep 17 00:00:00 2001 From: MystPi <86574651+MystPi@users.noreply.github.com> Date: Wed, 1 Nov 2023 08:08:51 -0400 Subject: [PATCH 2/2] Update about.md --- concepts/custom-types/about.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/concepts/custom-types/about.md b/concepts/custom-types/about.md index 098571482..e40885783 100644 --- a/concepts/custom-types/about.md +++ b/concepts/custom-types/about.md @@ -25,7 +25,7 @@ Creating a value for a specific case can be done by referring to its name if it ```gleam let spring = Spring -let integerTwo = SomeInt(2) +let integer_two = SomeInt(2) ``` Custom types, along with everything in Gleam, have _structural equality_, which means that two values of the same variant and with the same data are equivalent. @@ -43,10 +43,10 @@ Custom type variants can be pattern matched on using case expressions. import gleam/int import gleam/float -pub fn describe(number: Number) -> String { - case flexibleNumber { - SomeFloat(f) -> "Float: " ++ float.to_string(f) - SomeInt(i) -> "Int: " ++ int.to_string(i) +pub fn describe(flexible_number: Number) -> String { + case flexible_number { + SomeFloat(f) -> "Float: " <> float.to_string(f) + SomeInt(i) -> "Int: " <> int.to_string(i) Invalid -> "Neither a float nor an int" } }