diff options
Diffstat (limited to 'src/content/chapter4_standard_library/lesson04_option_module/code.gleam')
-rw-r--r-- | src/content/chapter4_standard_library/lesson04_option_module/code.gleam | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/content/chapter4_standard_library/lesson04_option_module/code.gleam b/src/content/chapter4_standard_library/lesson04_option_module/code.gleam new file mode 100644 index 0000000..eb60001 --- /dev/null +++ b/src/content/chapter4_standard_library/lesson04_option_module/code.gleam @@ -0,0 +1,14 @@ +import gleam/io +import gleam/option.{type Option, None, Some} + +pub type Person { + Person(name: String, pet: Option(String)) +} + +pub fn main() { + let person_with_pet = Person("Al", Some("Nubi")) + let person_without_pet = Person("Maria", None) + + io.debug(person_with_pet) + io.debug(person_without_pet) +} |