Skip to content

Commit

Permalink
better example of GetIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
MasonProtter committed Nov 28, 2022
1 parent 142abcb commit f8d0dfe
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/library.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1534,17 +1534,17 @@ $_experimental_warning
julia> using Transducers
using Transducers: GetIndex
julia> collect(GetIndex(1:10), [2, 3, 4])
3-element Vector{Int64}:
2
3
4
julia> collect(GetIndex('a':'z'), [2, 3, 4])
3-element Vector{Char}:
'b': ASCII/Unicode U+0062 (category Ll: Letter, lowercase)
'c': ASCII/Unicode U+0063 (category Ll: Letter, lowercase)
'd': ASCII/Unicode U+0064 (category Ll: Letter, lowercase)
julia> collect(GetIndex{true}(1:10), [2, 3, 4])
3-element Vector{Int64}:
2
3
4
julia> collect(GetIndex{true}('a':'z'), [2, 3, 4]) # Inbounds
3-element Vector{Char}:
'b': ASCII/Unicode U+0062 (category Ll: Letter, lowercase)
'c': ASCII/Unicode U+0063 (category Ll: Letter, lowercase)
'd': ASCII/Unicode U+0064 (category Ll: Letter, lowercase)
```
"""
struct GetIndex{inbounds, A} <: Transducer
Expand Down

0 comments on commit f8d0dfe

Please sign in to comment.