From f70130322cd306268c5da12c1517dc5725615ae8 Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Thu, 15 Feb 2024 12:18:17 +0000 Subject: text -> en --- .../lesson00_standard_library_package/en.html | 14 ++++++++ .../lesson00_standard_library_package/text.html | 14 -------- .../lesson01_list_module/en.html | 42 ++++++++++++++++++++++ .../lesson01_list_module/text.html | 42 ---------------------- .../lesson02_result_module/en.html | 40 +++++++++++++++++++++ .../lesson02_result_module/text.html | 40 --------------------- .../lesson03_dict_module/en.html | 40 +++++++++++++++++++++ .../lesson03_dict_module/text.html | 40 --------------------- .../lesson04_option_module/en.html | 16 +++++++++ .../lesson04_option_module/text.html | 16 --------- 10 files changed, 152 insertions(+), 152 deletions(-) create mode 100644 src/content/chapter4_standard_library/lesson00_standard_library_package/en.html delete mode 100644 src/content/chapter4_standard_library/lesson00_standard_library_package/text.html create mode 100644 src/content/chapter4_standard_library/lesson01_list_module/en.html delete mode 100644 src/content/chapter4_standard_library/lesson01_list_module/text.html create mode 100644 src/content/chapter4_standard_library/lesson02_result_module/en.html delete mode 100644 src/content/chapter4_standard_library/lesson02_result_module/text.html create mode 100644 src/content/chapter4_standard_library/lesson03_dict_module/en.html delete mode 100644 src/content/chapter4_standard_library/lesson03_dict_module/text.html create mode 100644 src/content/chapter4_standard_library/lesson04_option_module/en.html delete mode 100644 src/content/chapter4_standard_library/lesson04_option_module/text.html (limited to 'src/content/chapter4_standard_library') diff --git a/src/content/chapter4_standard_library/lesson00_standard_library_package/en.html b/src/content/chapter4_standard_library/lesson00_standard_library_package/en.html new file mode 100644 index 0000000..f5d7505 --- /dev/null +++ b/src/content/chapter4_standard_library/lesson00_standard_library_package/en.html @@ -0,0 +1,14 @@ +

+ The Gleam standard library is a regular Gleam package that has been published + to the Hex package repository. You could opt to + not use if you wish, though almost all Gleam projects depend on it. +

+

+ All of the modules imported so far in this guide, such as + gleam/io, are from the standard library. +

+

+ All of the documentation for the standard library is available on + HexDocs. We will go over some + of the most commonly used modules now. +

diff --git a/src/content/chapter4_standard_library/lesson00_standard_library_package/text.html b/src/content/chapter4_standard_library/lesson00_standard_library_package/text.html deleted file mode 100644 index f5d7505..0000000 --- a/src/content/chapter4_standard_library/lesson00_standard_library_package/text.html +++ /dev/null @@ -1,14 +0,0 @@ -

- The Gleam standard library is a regular Gleam package that has been published - to the Hex package repository. You could opt to - not use if you wish, though almost all Gleam projects depend on it. -

-

- All of the modules imported so far in this guide, such as - gleam/io, are from the standard library. -

-

- All of the documentation for the standard library is available on - HexDocs. We will go over some - of the most commonly used modules now. -

diff --git a/src/content/chapter4_standard_library/lesson01_list_module/en.html b/src/content/chapter4_standard_library/lesson01_list_module/en.html new file mode 100644 index 0000000..7451b10 --- /dev/null +++ b/src/content/chapter4_standard_library/lesson01_list_module/en.html @@ -0,0 +1,42 @@ +

+ The + gleam/list + standard library module contains functions for working with lists. A Gleam + program will likely make heavy use of this module, the various functions + serving as different types of loops over lists. +

+ +

+ map + makes a new list by running a function on each element in a list. +

+

+ filter + makes a new list containing only the elements for which a function returns + true. +

+

+ fold + combines all the elements in a list into a single value by running a function + left-to-right on each element, passing the result of the previous call to the + next call. +

+

+ find + returns the first element in a list for which a function returns + True. +

+

+ It's worth getting familiar with all the functions in this module when writing + Gleam code, you'll be using them a lot! +

diff --git a/src/content/chapter4_standard_library/lesson01_list_module/text.html b/src/content/chapter4_standard_library/lesson01_list_module/text.html deleted file mode 100644 index 7451b10..0000000 --- a/src/content/chapter4_standard_library/lesson01_list_module/text.html +++ /dev/null @@ -1,42 +0,0 @@ -

- The - gleam/list - standard library module contains functions for working with lists. A Gleam - program will likely make heavy use of this module, the various functions - serving as different types of loops over lists. -

- -

- map - makes a new list by running a function on each element in a list. -

-

- filter - makes a new list containing only the elements for which a function returns - true. -

-

- fold - combines all the elements in a list into a single value by running a function - left-to-right on each element, passing the result of the previous call to the - next call. -

-

- find - returns the first element in a list for which a function returns - True. -

-

- It's worth getting familiar with all the functions in this module when writing - Gleam code, you'll be using them a lot! -

diff --git a/src/content/chapter4_standard_library/lesson02_result_module/en.html b/src/content/chapter4_standard_library/lesson02_result_module/en.html new file mode 100644 index 0000000..4901afd --- /dev/null +++ b/src/content/chapter4_standard_library/lesson02_result_module/en.html @@ -0,0 +1,40 @@ +

+ The + gleam/result + standard library module contains functions for working with results. Gleam + programs will make heavy use of this module to avoid excessive nested case + expressions when calling multiple functions that can fail. +

+ +

+ map + updates a value held within the Ok of a result by calling a given function on + it. If the result is an error then the function is not called. +

+ +

+ try + runs a result returning function on the value held within an Ok of a result. + If the result is an error then the function is not called. This is useful for + chaining together multiple function calls that can fail, one after the other, + stopping at the first error. +

+ +

+ unwrap + extracts the success value from a result, or returning a default value if the + result is an error. +

+ +

+ Result functions are often used with pipelines to chain together multiple + calls to result returning functions. +

diff --git a/src/content/chapter4_standard_library/lesson02_result_module/text.html b/src/content/chapter4_standard_library/lesson02_result_module/text.html deleted file mode 100644 index 4901afd..0000000 --- a/src/content/chapter4_standard_library/lesson02_result_module/text.html +++ /dev/null @@ -1,40 +0,0 @@ -

- The - gleam/result - standard library module contains functions for working with results. Gleam - programs will make heavy use of this module to avoid excessive nested case - expressions when calling multiple functions that can fail. -

- -

- map - updates a value held within the Ok of a result by calling a given function on - it. If the result is an error then the function is not called. -

- -

- try - runs a result returning function on the value held within an Ok of a result. - If the result is an error then the function is not called. This is useful for - chaining together multiple function calls that can fail, one after the other, - stopping at the first error. -

- -

- unwrap - extracts the success value from a result, or returning a default value if the - result is an error. -

- -

- Result functions are often used with pipelines to chain together multiple - calls to result returning functions. -

diff --git a/src/content/chapter4_standard_library/lesson03_dict_module/en.html b/src/content/chapter4_standard_library/lesson03_dict_module/en.html new file mode 100644 index 0000000..f7eb879 --- /dev/null +++ b/src/content/chapter4_standard_library/lesson03_dict_module/en.html @@ -0,0 +1,40 @@ +

+ The + gleam/dict + standard library module defines Gleam's Dict type and functions + for working with it. A dict is a collection of keys and values which other + languages may call a hashmap or table. +

+ +

+ new + and + from_list + can be used to create new dicts. +

+ +

+ insert + and + delete + are used to add and remove items from a dict. +

+

+ Like lists, dicts are immutable. Inserting or deleting an item from a dict + will return a new dict with the item added or removed. +

+

+ Dicts are unordered! If it appears that the items in a dict are in a certain + order this is incidental and should not be relied upon. Any ordering may + change without warning in future versions or on different runtimes. +

diff --git a/src/content/chapter4_standard_library/lesson03_dict_module/text.html b/src/content/chapter4_standard_library/lesson03_dict_module/text.html deleted file mode 100644 index f7eb879..0000000 --- a/src/content/chapter4_standard_library/lesson03_dict_module/text.html +++ /dev/null @@ -1,40 +0,0 @@ -

- The - gleam/dict - standard library module defines Gleam's Dict type and functions - for working with it. A dict is a collection of keys and values which other - languages may call a hashmap or table. -

- -

- new - and - from_list - can be used to create new dicts. -

- -

- insert - and - delete - are used to add and remove items from a dict. -

-

- Like lists, dicts are immutable. Inserting or deleting an item from a dict - will return a new dict with the item added or removed. -

-

- Dicts are unordered! If it appears that the items in a dict are in a certain - order this is incidental and should not be relied upon. Any ordering may - change without warning in future versions or on different runtimes. -

diff --git a/src/content/chapter4_standard_library/lesson04_option_module/en.html b/src/content/chapter4_standard_library/lesson04_option_module/en.html new file mode 100644 index 0000000..0c66b25 --- /dev/null +++ b/src/content/chapter4_standard_library/lesson04_option_module/en.html @@ -0,0 +1,16 @@ +

+ Values in Gleam are not nullable, so the + gleam/option + standard library module defines Gleam's Option type, which can be + used to represent a value that is either present or absent. +

+ +

+ The option type is very similar to the result type, but it does not have an + error value. Some languages have functions return an option when there is no + extra error detail to give, but Gleam always uses result. This makes all + fallible functions consistent and removes any boilerplate that would be + required when mixing functions that use each type. +

diff --git a/src/content/chapter4_standard_library/lesson04_option_module/text.html b/src/content/chapter4_standard_library/lesson04_option_module/text.html deleted file mode 100644 index 0c66b25..0000000 --- a/src/content/chapter4_standard_library/lesson04_option_module/text.html +++ /dev/null @@ -1,16 +0,0 @@ -

- Values in Gleam are not nullable, so the - gleam/option - standard library module defines Gleam's Option type, which can be - used to represent a value that is either present or absent. -

- -

- The option type is very similar to the result type, but it does not have an - error value. Some languages have functions return an option when there is no - extra error detail to give, but Gleam always uses result. This makes all - fallible functions consistent and removes any boilerplate that would be - required when mixing functions that use each type. -

-- cgit v1.2.3