1
0
mirror of https://github.com/onkelbeh/cheatsheets.git synced 2026-08-15 21:44:51 +02:00

Merge branch 'pr-347'

* pr-347:
  elixir: shorten some sentences
  fix concat result
  Add Case control flow structre and remove css class
This commit is contained in:
Rico Sta. Cruz
2018-03-17 13:26:04 +08:00

View File

@@ -116,6 +116,18 @@ else
"This will"
end
```
### Case
```elixir
case {1, 2, 3} do
{4, 5, 6} ->
"This clause won't match"
{1, x, 3} ->
"This will match and bind x to 2"
_ ->
"This will match any value"
end
```
### Cond
@@ -466,7 +478,7 @@ list |> any?() # → true
```
```elixir
list |> concat([:d]) # → [:d]
list |> concat([:d]) # → [:a, :b, :c, :d]
```
Also, consider streams instead.