From 7670c0927af9c1d97eae38744f8cb964ce0fb2ae Mon Sep 17 00:00:00 2001 From: Jeremie Gillet Date: Sat, 11 Nov 2023 15:32:10 +0900 Subject: [PATCH 1/2] Add Elm Analyzer comment for concept exercise `gotta-snatch-em-all` --- .../elm/gotta-snatch-em-all/boringCards_use_fold.md | 4 ++++ .../elm/gotta-snatch-em-all/totalCards_use_fold.md | 4 ++++ analyzer-comments/elm/gotta-snatch-em-all/use_diff.md | 3 +++ analyzer-comments/elm/gotta-snatch-em-all/use_intersect.md | 3 +++ analyzer-comments/elm/gotta-snatch-em-all/use_partition.md | 3 +++ analyzer-comments/elm/gotta-snatch-em-all/use_set.md | 3 +++ analyzer-comments/elm/gotta-snatch-em-all/use_singleton.md | 3 +++ analyzer-comments/elm/gotta-snatch-em-all/use_union.md | 3 +++ 8 files changed, 26 insertions(+) create mode 100644 analyzer-comments/elm/gotta-snatch-em-all/boringCards_use_fold.md create mode 100644 analyzer-comments/elm/gotta-snatch-em-all/totalCards_use_fold.md create mode 100644 analyzer-comments/elm/gotta-snatch-em-all/use_diff.md create mode 100644 analyzer-comments/elm/gotta-snatch-em-all/use_intersect.md create mode 100644 analyzer-comments/elm/gotta-snatch-em-all/use_partition.md create mode 100644 analyzer-comments/elm/gotta-snatch-em-all/use_set.md create mode 100644 analyzer-comments/elm/gotta-snatch-em-all/use_singleton.md create mode 100644 analyzer-comments/elm/gotta-snatch-em-all/use_union.md diff --git a/analyzer-comments/elm/gotta-snatch-em-all/boringCards_use_fold.md b/analyzer-comments/elm/gotta-snatch-em-all/boringCards_use_fold.md new file mode 100644 index 000000000..ad37d6815 --- /dev/null +++ b/analyzer-comments/elm/gotta-snatch-em-all/boringCards_use_fold.md @@ -0,0 +1,4 @@ +# boringCards use fold + +The function `boringCards` can be elegantly written with a `List.foldl` (or `List.foldl`). +Try it out! diff --git a/analyzer-comments/elm/gotta-snatch-em-all/totalCards_use_fold.md b/analyzer-comments/elm/gotta-snatch-em-all/totalCards_use_fold.md new file mode 100644 index 000000000..558563e3c --- /dev/null +++ b/analyzer-comments/elm/gotta-snatch-em-all/totalCards_use_fold.md @@ -0,0 +1,4 @@ +# totalCards use fold + +The function `totalCards` can be elegantly written with a `List.foldl` (or `List.foldl`). +Try it out! diff --git a/analyzer-comments/elm/gotta-snatch-em-all/use_diff.md b/analyzer-comments/elm/gotta-snatch-em-all/use_diff.md new file mode 100644 index 000000000..a6056af8d --- /dev/null +++ b/analyzer-comments/elm/gotta-snatch-em-all/use_diff.md @@ -0,0 +1,3 @@ +# use diff + +For the purpose of learning about the `Set` module, define `extraCards` with `Set.diff`, the most suitable function for the job. diff --git a/analyzer-comments/elm/gotta-snatch-em-all/use_intersect.md b/analyzer-comments/elm/gotta-snatch-em-all/use_intersect.md new file mode 100644 index 000000000..0e2bde57a --- /dev/null +++ b/analyzer-comments/elm/gotta-snatch-em-all/use_intersect.md @@ -0,0 +1,3 @@ +# use intersect + +For the purpose of learning about the `Set` module, define `boringCards` with `Set.intersect`, the most suitable function for the job. diff --git a/analyzer-comments/elm/gotta-snatch-em-all/use_partition.md b/analyzer-comments/elm/gotta-snatch-em-all/use_partition.md new file mode 100644 index 000000000..c9848cb24 --- /dev/null +++ b/analyzer-comments/elm/gotta-snatch-em-all/use_partition.md @@ -0,0 +1,3 @@ +# use partition + +For the purpose of learning about the `Set` module, define `splitShinyCards` with `Set.partition`, the most suitable function for the job. diff --git a/analyzer-comments/elm/gotta-snatch-em-all/use_set.md b/analyzer-comments/elm/gotta-snatch-em-all/use_set.md new file mode 100644 index 000000000..39d5ace21 --- /dev/null +++ b/analyzer-comments/elm/gotta-snatch-em-all/use_set.md @@ -0,0 +1,3 @@ +# use set + +For the purpose of learning about the `Set` module, define `removeDuplicates` exclusively with `Set` functions. diff --git a/analyzer-comments/elm/gotta-snatch-em-all/use_singleton.md b/analyzer-comments/elm/gotta-snatch-em-all/use_singleton.md new file mode 100644 index 000000000..fbc545686 --- /dev/null +++ b/analyzer-comments/elm/gotta-snatch-em-all/use_singleton.md @@ -0,0 +1,3 @@ +# use singleton + +For the purpose of learning about the `Set` module, define `newCollection` with `Set.singleton`, the most suitable function for the job. diff --git a/analyzer-comments/elm/gotta-snatch-em-all/use_union.md b/analyzer-comments/elm/gotta-snatch-em-all/use_union.md new file mode 100644 index 000000000..f343f8095 --- /dev/null +++ b/analyzer-comments/elm/gotta-snatch-em-all/use_union.md @@ -0,0 +1,3 @@ +# use union + +For the purpose of learning about the `Set` module, define `totalCards` with `Set.union`, the most suitable function for the job. From 47497614e6540df64b4fdfa12fb43f468a215b9c Mon Sep 17 00:00:00 2001 From: Jie Date: Tue, 14 Nov 2023 07:54:33 +0800 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Cedd Burge --- .../elm/gotta-snatch-em-all/boringCards_use_fold.md | 2 +- .../elm/gotta-snatch-em-all/totalCards_use_fold.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/analyzer-comments/elm/gotta-snatch-em-all/boringCards_use_fold.md b/analyzer-comments/elm/gotta-snatch-em-all/boringCards_use_fold.md index ad37d6815..c8da123e9 100644 --- a/analyzer-comments/elm/gotta-snatch-em-all/boringCards_use_fold.md +++ b/analyzer-comments/elm/gotta-snatch-em-all/boringCards_use_fold.md @@ -1,4 +1,4 @@ # boringCards use fold -The function `boringCards` can be elegantly written with a `List.foldl` (or `List.foldl`). +The function `boringCards` can be elegantly written with a `List.foldr` (or `List.foldl`). Try it out! diff --git a/analyzer-comments/elm/gotta-snatch-em-all/totalCards_use_fold.md b/analyzer-comments/elm/gotta-snatch-em-all/totalCards_use_fold.md index 558563e3c..1df59ca78 100644 --- a/analyzer-comments/elm/gotta-snatch-em-all/totalCards_use_fold.md +++ b/analyzer-comments/elm/gotta-snatch-em-all/totalCards_use_fold.md @@ -1,4 +1,4 @@ # totalCards use fold -The function `totalCards` can be elegantly written with a `List.foldl` (or `List.foldl`). +The function `totalCards` can be elegantly written with a `List.foldr` (or `List.foldl`). Try it out!