Skip to content

Commit d38a1eb

Browse files
committed
Updated README.
1 parent c46aab2 commit d38a1eb

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,29 @@
1-
Array
2-
=====
1+
# Array
32

43
An Elixir wrapper for Erlang's array.
4+
5+
Supports Access, Enumerable and Collectable protocols.
6+
7+
## Example
8+
9+
```
10+
# Create
11+
arr = Array.new()
12+
13+
# Update
14+
arr = Array.set(arr, 0, 100)
15+
16+
# Access by indices
17+
arr[0]
18+
19+
# Convert from/to list
20+
Array.from_list([1,2,3,4,5])
21+
Array.to_list(arr)
22+
23+
# Transform using the Enum module
24+
Array.from_list([1,2,3,4,5]) |> Enum.map(fn x -> 2*x end)
25+
Enum.into(0..100, Array.new())
26+
27+
# Comprehension
28+
for v <- Array.from_list([1,2,3,4,5]), into: Array.new(), do: v*2
29+
```

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ defmodule Array.Mixfile do
44
def project do
55
[app: :array,
66
version: "0.0.1",
7-
elixir: "~> 0.15.1",
7+
elixir: "~> 1.0.0",
88
package: package,
99
deps: deps]
1010
end

0 commit comments

Comments
 (0)