We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6958c74 commit 9ae7401Copy full SHA for 9ae7401
README.md
@@ -136,6 +136,36 @@ iex> Enum.to_list Qex.join(q1, q2)
136
[1, 2, 3, 4, 5]
137
```
138
139
+#### Return the first item
140
+
141
+```elixir
142
+iex> q1 = Qex.new 1..3
143
+iex> Qex.first(q1)
144
+{:value, 1}
145
+iex> q2 = Qex.new []
146
+iex> Qex.first(q2)
147
+:empty
148
149
150
+iex> Qex.first!(q1)
151
+1
152
+```
153
154
+#### Return the last item
155
156
157
158
+iex> Qex.last(q1)
159
+{:value, 3}
160
161
+iex> Qex.last(q2)
162
163
164
165
+iex> Qex.last!(q1)
166
+3
167
168
169
## Why not "Queue"?
170
171
The name is taken... [Hex link](https://hex.pm/packages/queue)
0 commit comments