Combinatorics.jl icon indicating copy to clipboard operation
Combinatorics.jl copied to clipboard

collect(powerset(::Set)) doesn't work

Open anandijain opened this issue 5 years ago • 0 comments

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.

anandijain avatar Aug 21 '20 19:08 anandijain