//
//  CHSetExtensions.h
//  Chocolat
//
//  Created by Pieter Omvlee on 5/30/08.
//  Copyright 2008 Bohemian Coding. All rights reserved.
//

#import <Cocoa/Cocoa.h>

#import "CHArrayExtensions.h"

/*!
 * @header CHSetExtensions
 * Functional-programming extensions to NSArray
 */
@interface NSSet (CHSetExtensions)

- (BOOL)containsObjectFromArray:(NSArray *)anArray;

- (NSSet *)map:(SEL)sel;
- (NSSet *)map:(SEL)sel withObject:(id)obj;
- (NSSet *)map:(SEL)sel withObject:(id)obj1 withObject:(id)obj2;

- (NSSet *)setByRemovingObject:(id)anObject;

+ (NSSet *)setByMergingSetsInArray:(NSArray *)anArray;
+ (NSSet *)setByMergingSet:(NSSet *)set1 andSet:(NSSet *)set2;

+ (NSSet *)setByMergingArraysInArray:(NSArray *)anArray;
+ (NSSet *)setByMergingArray:(NSArray *)array1 andArray:(NSArray *)array2;

@end

@interface NSSet (NSSetAdditions)
- (id)deepCopy;
- (id)mutableDeepCopy;
@end

@interface NSDictionary (NSDictionaryAdditions)
- (id)deepCopy;
- (id)mutableDeepCopy;
@end

@interface NSMutableSet (NSMutableSetAdditions)
- (void)addObjectIfNotNil:(id)anObject;
@end