Vulsan Bianca
Vulsan Bianca

Reputation: 189

Loop through the elements of a set in elm

Can I loop through elements of a Set in Elm? Or at least convert the Set to a List? There exists Set.fromList, but I don't find any List.fromSet or something similar. I know there is no for loop in Elm, but I want to go through the elements recursively like I do in case of list:

        interate lst = 
        case lst of
            [] -> False
            x::xs -> ...

but for a Set.

Upvotes: 1

Views: 128

Answers (1)

Gabriel Stancu
Gabriel Stancu

Reputation: 4240

I would use Set.toList for this.

Upvotes: 3

Related Questions