Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
runs-on: ubuntu-24.04
strategy:
matrix:
elixir: [1.18.1]
otp: [27.2]
elixir: [1.19.2]
otp: [28.1]

steps:
- name: Checkout code
Expand Down Expand Up @@ -76,8 +76,6 @@ jobs:
strategy:
matrix:
include:
- elixir: '1.14.0'
otp: '25.0'
- elixir: '1.15.0'
otp: '26.0'
- elixir: '1.16.0'
Expand All @@ -86,6 +84,8 @@ jobs:
otp: '27.0'
- elixir: '1.18.1'
otp: '27.2'
- elixir: '1.19.2'
otp: '28.1'

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

## Setup

The exercises currently target Elixir versions from 1.14 to 1.18 and Erlang/OTP versions from 25 to 27. Detailed installation instructions can be found at
The exercises currently target Elixir versions from 1.15 to 1.19 and Erlang/OTP versions from 25 to 27. Detailed installation instructions can be found at
[https://elixir-lang.org/install.html](https://elixir-lang.org/install.html). We recommend using the [asdf version manager](https://github.com/asdf-vm/asdf) to manage multiple Elixir versions.

## Testing
Expand Down
2 changes: 1 addition & 1 deletion concepts/mapsets/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ MapSet.symmetric_difference(b, a)
# => MapSet.new([2, 3, 4, 5, 6, 7, 8, 9, 100])
```

You can filter and partition sets with `MapSet.filter/2`, `MapSet.reject/2` and `MapSet.split_with/2` (from Elixir 1.15).
You can filter and partition sets with `MapSet.filter/2`, `MapSet.reject/2` and `MapSet.split_with/2`.

```elixir
a = MapSet.new([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
Expand Down
2 changes: 1 addition & 1 deletion concepts/mapsets/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ MapSet.symmetric_difference(b, a)
# => MapSet.new([2, 3, 4, 5, 6, 7, 8, 9, 100])
```

You can filter and partition sets with `MapSet.filter/2`, `MapSet.reject/2` and `MapSet.split_with/2` (from Elixir 1.15).
You can filter and partition sets with `MapSet.filter/2`, `MapSet.reject/2` and `MapSet.split_with/2`.

```elixir
a = MapSet.new([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
Expand Down
4 changes: 1 addition & 3 deletions exercises/concept/gotta-snatch-em-all/.docs/hints.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

## 8. Shiny for the win

- Use [this `MapSet` function][split_with] to separate your collection (from Elixir 1.15, otherwise, [this][filter] and [that][reject] function can be used instead)
- Use [this `MapSet` function][split_with] to separate your collection
- Use [this `String` function][starts_with] to detect shiny cards
- [This `MapSet` function][to_list] can create a list
- `MapSet`s do not have a notion of order, you should use [this `Enum` function][sort] to sort the cards, even if the tests pass without it
Expand All @@ -64,8 +64,6 @@
[new_empty]: https://hexdocs.pm/elixir/MapSet.html#new/0
[union]: https://hexdocs.pm/elixir/MapSet.html#union/2
[split_with]: https://hexdocs.pm/elixir/MapSet.html#split_with/2
[filter]: https://hexdocs.pm/elixir/MapSet.html#filter/2
[reject]: https://hexdocs.pm/elixir/MapSet.html#reject/2
[starts_with]: https://hexdocs.pm/elixir/String.html#starts_with?/2
[enum]: https://hexdocs.pm/elixir/Enum.html
[reduce]: https://hexdocs.pm/elixir/Enum.html#reduce/3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ MapSet.symmetric_difference(b, a)
# => MapSet.new([2, 3, 4, 5, 6, 7, 8, 9, 100])
```

You can filter and partition sets with `MapSet.filter/2`, `MapSet.reject/2` and `MapSet.split_with/2` (from Elixir 1.15).
You can filter and partition sets with `MapSet.filter/2`, `MapSet.reject/2` and `MapSet.split_with/2`.

```elixir
a = MapSet.new([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
Expand Down
15 changes: 1 addition & 14 deletions exercises/concept/gotta-snatch-em-all/.meta/exemplar.ex
Original file line number Diff line number Diff line change
Expand Up @@ -62,24 +62,11 @@ defmodule GottaSnatchEmAll do

@spec split_shiny_cards(collection()) :: {[card()], [card()]}
def split_shiny_cards(collection) do
{shiny, not_shiny} = split_with(collection, &String.starts_with?(&1, "Shiny"))
{shiny, not_shiny} = MapSet.split_with(collection, &String.starts_with?(&1, "Shiny"))

shiny_list = shiny |> MapSet.to_list() |> Enum.sort()
not_shiny_list = not_shiny |> MapSet.to_list() |> Enum.sort()

{shiny_list, not_shiny_list}
end

# MapSet.split_with/2 was added in Elixir 1.15 - Switch to that when it becomes the minimum version
defp split_with(mapset, predicate) do
init = {MapSet.new(), MapSet.new()}

Enum.reduce(mapset, init, fn item, {passes, fails} ->
if predicate.(item) do
{MapSet.put(passes, item), fails}
else
{passes, MapSet.put(fails, item)}
end
end)
end
end
7 changes: 4 additions & 3 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ defmodule ExercismTestRunner.Mixfile do
paths: ["_build"],
plt_core_path: "priv/plts",
plt_file: {:no_warn, "priv/plts/eventstore.plt"},
ignore_warnings: ".dialyzer_ignore.exs"
ignore_warnings: ".dialyzer_ignore.exs",
flags: [:no_opaque]
]
]
end
Expand All @@ -24,9 +25,9 @@ defmodule ExercismTestRunner.Mixfile do

defp deps do
[
{:dialyxir, "~> 1.3.0", runtime: false},
{:dialyxir, "~> 1.4.7", runtime: false},
{:markdown_code_block_formatter, "~> 0.1.0", runtime: false},
{:doctest_formatter, "~> 0.2.0", runtime: false}
{:doctest_formatter, "~> 0.4.0", runtime: false}
]
end
end
6 changes: 3 additions & 3 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%{
"dialyxir": {:hex, :dialyxir, "1.3.0", "fd1672f0922b7648ff9ce7b1b26fcf0ef56dda964a459892ad15f6b4410b5284", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "00b2a4bcd6aa8db9dcb0b38c1225b7277dca9bc370b6438715667071a304696f"},
"doctest_formatter": {:hex, :doctest_formatter, "0.2.0", "fe6198e8d81d833269314696b5bb55c0db0e16f609de53cdcafe1758f53ecf6c", [:mix], [], "hexpm", "34fb0da7cbb704d5caf477e77268fcf7ee9c87e13d94a04ea1865afb9e82e3f5"},
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
"dialyxir": {:hex, :dialyxir, "1.4.7", "dda948fcee52962e4b6c5b4b16b2d8fa7d50d8645bbae8b8685c3f9ecb7f5f4d", [:mix], [{:erlex, ">= 0.2.8", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "b34527202e6eb8cee198efec110996c25c5898f43a4094df157f8d28f27d9efe"},
"doctest_formatter": {:hex, :doctest_formatter, "0.4.1", "c69bf93853d1ec5785cbd22dcf0c2bd4dd357cc53f2e89d05850eed7e985462a", [:mix], [], "hexpm", "c1b07495a524126de133be4e077b28c4a2d8e1a14c9eeca962482e2067b5b068"},
"erlex": {:hex, :erlex, "0.2.8", "cd8116f20f3c0afe376d1e8d1f0ae2452337729f68be016ea544a72f767d9c12", [:mix], [], "hexpm", "9d66ff9fedf69e49dc3fd12831e12a8a37b76f8651dd21cd45fcf5561a8a7590"},
"markdown_code_block_formatter": {:hex, :markdown_code_block_formatter, "0.1.0", "1eb35408f0ce2cbd40086fea5bbb2aebbb4805ffc2c967f9e54aa724fa4bd222", [:mix], [], "hexpm", "ce27a7c7497074c48941c1d74ab9c39a08db31f2875b867c6d5671d7d70682b0"},
}
Loading