From 999b4849e81604bc23fd52d94d93f12e411cebdd Mon Sep 17 00:00:00 2001 From: Jie Date: Fri, 10 Nov 2023 10:57:50 +0900 Subject: [PATCH] Add Elm Analyzer comments for concept exercise `tisbury-treasure-hunt` (#2294) --- .../use_placeLocationToTreasureLocation.md | 3 +++ .../elm/tisbury-treasure-hunt/use_tuple_in_case.md | 3 +++ .../elm/tisbury-treasure-hunt/use_tuple_second.md | 4 ++++ 3 files changed, 10 insertions(+) create mode 100644 analyzer-comments/elm/tisbury-treasure-hunt/use_placeLocationToTreasureLocation.md create mode 100644 analyzer-comments/elm/tisbury-treasure-hunt/use_tuple_in_case.md create mode 100644 analyzer-comments/elm/tisbury-treasure-hunt/use_tuple_second.md diff --git a/analyzer-comments/elm/tisbury-treasure-hunt/use_placeLocationToTreasureLocation.md b/analyzer-comments/elm/tisbury-treasure-hunt/use_placeLocationToTreasureLocation.md new file mode 100644 index 000000000..b5542c92e --- /dev/null +++ b/analyzer-comments/elm/tisbury-treasure-hunt/use_placeLocationToTreasureLocation.md @@ -0,0 +1,3 @@ +# use placeLocationToTreasureLocation + +Please use `placeLocationToTreasureLocation` in `treasureLocationMatchesPlaceLocation`, as reusing functions helps with maintainability. diff --git a/analyzer-comments/elm/tisbury-treasure-hunt/use_tuple_in_case.md b/analyzer-comments/elm/tisbury-treasure-hunt/use_tuple_in_case.md new file mode 100644 index 000000000..8ff255229 --- /dev/null +++ b/analyzer-comments/elm/tisbury-treasure-hunt/use_tuple_in_case.md @@ -0,0 +1,3 @@ +# use tuple in case + +Like the instructions mention, when defining `specialCaseSwapPossible` you should use a `case` statement on a tuple with the three values of interest and pattern match on the combinations that allow swapping. diff --git a/analyzer-comments/elm/tisbury-treasure-hunt/use_tuple_second.md b/analyzer-comments/elm/tisbury-treasure-hunt/use_tuple_second.md new file mode 100644 index 000000000..74b5e9451 --- /dev/null +++ b/analyzer-comments/elm/tisbury-treasure-hunt/use_tuple_second.md @@ -0,0 +1,4 @@ +# use tuple second + +You will find that `Tuple.second` is very well suited for defining `countPlaceTreasures`, you can map it on the list of treasures or use it in a `List.filter` function. +Try it out!