maybeSetUnions :: Ord a => Set.Set (Maybe (Set.Set a)) -> Set.Set a
maybeSetUnions = Set.fold f Set.empty where
    f mS s' = maybe s' (Set.union s') mS
maybeSetUnions :: Ord a => Set.Set (Maybe (Set.Set a)) -> Set.Set a
maybeSetUnions = Set.fold f Set.empty where
    f mS s' = maybe s' (Set.union s') mS
maybeSetUnions = Set.fold f Set.empty where
    f mS s' = maybe s' (Set.union s') mS