feat: added cleanscript

This commit is contained in:
2026-06-22 21:27:36 +05:30
parent dbddc0ce2d
commit 4581eea409
309 changed files with 14551 additions and 46035 deletions

19
ch06/ch06-00-enums.html Normal file
View File

@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Enums and Pattern Matching</title>
</head>
<body>
<h1 id="enums-and-pattern-matching"><a class="header" href="#enums-and-pattern-matching">Enums and Pattern Matching</a></h1>
<p>In this chapter, well look at enumerations, also referred to as <em>enums</em>.
Enums allow you to define a type by enumerating its possible variants. First
well define and use an enum to show how an enum can encode meaning along with
data. Next, well explore a particularly useful enum, called <code>Option</code>, which
expresses that a value can be either something or nothing. Then, well look at
how pattern matching in the <code>match</code> expression makes it easy to run different
code for different values of an enum. Finally, well cover how the <code>if let</code>
construct is another convenient and concise idiom available to handle enums in
your code.</p>
</body>
</html>