Created
October 16, 2016 05:22
-
-
Save dela3499/98713933324a24a166f8107b494c5c24 to your computer and use it in GitHub Desktop.
Toggle membership in a set
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Set exposing (Set) | |
toggleMember: String -> Set String -> Set String | |
toggleMember value set = | |
if Set.member value set then | |
Set.remove value set | |
else | |
Set.insert value set |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment