Remove Windows-style carriage returns from line endings

This commit is contained in:
Colin Sheaff
2020-01-08 14:38:16 -06:00
parent 2db7a6545f
commit b443e87707

View File

@@ -1,33 +1,33 @@
defmodule Comprehensions do defmodule Comprehensions do
use Koans use Koans
@intro "A comprehension is made of three parts: generators, filters, and collectibles. We will look at how these interact with eachother" @intro "A comprehension is made of three parts: generators, filters, and collectibles. We will look at how these interact with eachother"
koan "The generator, `n <- [1, 2, 3, 4]`, is providing the values for our comprehension" do koan "The generator, `n <- [1, 2, 3, 4]`, is providing the values for our comprehension" do
assert (for n <- [1, 2, 3, 4], do: n * n) == ___ assert (for n <- [1, 2, 3, 4], do: n * n) == ___
end end
koan "Any enumerable can be a generator" do koan "Any enumerable can be a generator" do
assert (for n <- 1..4, do: n * n) == ___ assert (for n <- 1..4, do: n * n) == ___
end end
koan "A generator specifies how to extract values from a collection" do koan "A generator specifies how to extract values from a collection" do
collection = [["Hello","World"], ["Apple", "Pie"]] collection = [["Hello","World"], ["Apple", "Pie"]]
assert (for [a, b] <- collection, do: "#{a} #{b}") == ___ assert (for [a, b] <- collection, do: "#{a} #{b}") == ___
end end
koan "You can use multiple generators at once" do koan "You can use multiple generators at once" do
assert (for x <- ["little", "big"], y <- ["dogs", "cats"], do: "#{x} #{y}") == ___ assert (for x <- ["little", "big"], y <- ["dogs", "cats"], do: "#{x} #{y}") == ___
end end
koan "Use a filter to reduce your work" do koan "Use a filter to reduce your work" do
assert (for n <- [1, 2, 3, 4, 5, 6], n > 3, do: n) == ___ assert (for n <- [1, 2, 3, 4, 5, 6], n > 3, do: n) == ___
end end
koan "Add the result of a comprehension to an existing collection" do koan "Add the result of a comprehension to an existing collection" do
collection = ["Apple Pie"] collection = ["Apple Pie"]
collection = for x <- ["Pecan", "Pumpkin"], into: collection, do: "#{x} Pie" collection = for x <- ["Pecan", "Pumpkin"], into: collection, do: "#{x} Pie"
assert collection == ___ assert collection == ___
end end
end end