Combinatorics.jl
Combinatorics.jl copied to clipboard
collect(powerset(::Set)) doesn't work
powerset(::Set) works, but returns Iterator.
julia> s
Set{Char} with 3 elements:
'a'
'c'
'b'
julia> collect(powerset(s))
ERROR: MethodError: no method matching getindex(::Set{Char}, ::Int64)
collect(powerset(collect(s))) works as expected though.
I think it'd be nice to be able to work with set theory without syntactic issues like this, particularly for pedagogic purposes.
edit: sorry accidentally pressed enter and it made the issue.