Skip to content

Commit 22a38bd

Browse files
committed
Update readme
1 parent 0fc0ead commit 22a38bd

File tree

1 file changed

+65
-6
lines changed

1 file changed

+65
-6
lines changed

README.md

Lines changed: 65 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
A bunch of tools for using tuples (mostly homogeneous tuples `NTuple{N}`) as a collection and performing a number of operations with an inferrable result, typically also an `NTuple{M}` with inferrable length `M`. Type inference breaks down if some of the final or intermediate tuples exceed `MAX_TUPLETYPE_LEN`, meaning inference typically works up to output tuples of length `13` or `14`. Chosen implementations are typically faster than the corresponding functions in base for those small tuple lengths, but can be slower for larger tuples. Inference also breaks down for most functions in case of inhomogeneous tuples.
1111

1212

13+
Note that none of the following functions are exported, since their name often collides with the equivalent from `Base`.
14+
15+
1316
<a id='Types-1'></a>
1417

1518
## Types
@@ -140,16 +143,72 @@ prod(t::Tuple)
140143

141144
Returns the product of the elements of a tuple, or `1` for an empty tuple.
142145

146+
<a id='TupleTools.minimum' href='#TupleTools.minimum'>#</a>
147+
**`TupleTools.minimum`** &mdash; *Function*.
148+
149+
150+
151+
```
152+
minimum(t::Tuple)
153+
```
154+
155+
Returns the smallest element of a tuple
156+
157+
<a id='TupleTools.maximum' href='#TupleTools.maximum'>#</a>
158+
**`TupleTools.maximum`** &mdash; *Function*.
159+
160+
161+
162+
```
163+
maximum(t::Tuple)
164+
```
165+
166+
Returns the largest element of a tuple
167+
168+
<a id='TupleTools.findmin' href='#TupleTools.findmin'>#</a>
169+
**`TupleTools.findmin`** &mdash; *Function*.
170+
171+
172+
173+
```
174+
findmin(t::Tuple)
175+
```
176+
177+
Returns the value and index of the minimum element in a tuple. If there are multiple minimal elements, then the first one will be returned.
178+
179+
<a id='TupleTools.findmax' href='#TupleTools.findmax'>#</a>
180+
**`TupleTools.findmax`** &mdash; *Function*.
181+
182+
183+
184+
```
185+
findmax(t::Tuple)
186+
```
187+
188+
Returns the value and index of the maximum element in a tuple. If there are multiple maximal elements, then the first one will be returned.
189+
190+
<a id='TupleTools.indmin' href='#TupleTools.indmin'>#</a>
191+
**`TupleTools.indmin`** &mdash; *Function*.
192+
193+
194+
195+
```
196+
indmin(t::Tuple)
197+
```
198+
199+
Returns the index of the minimum element in a tuple. If there are multiple minimal elements, then the first one will be returned.
200+
201+
<a id='TupleTools.indmax' href='#TupleTools.indmax'>#</a>
202+
**`TupleTools.indmax`** &mdash; *Function*.
203+
204+
143205

144206
```
145-
TupleTools.minimum
146-
TupleTools.maximum
147-
TupleTools.findmin
148-
TupleTools.findmax
149-
TupleTools.indmin
150-
TupleTools.indmax
207+
indmax(t::Tuple)
151208
```
152209

210+
Returns the index of the maximum element in a tuple. If there are multiple minimal elements, then the first one will be returned.
211+
153212
<a id='TupleTools.sort' href='#TupleTools.sort'>#</a>
154213
**`TupleTools.sort`** &mdash; *Function*.
155214

0 commit comments

Comments
 (0)