-
Notifications
You must be signed in to change notification settings - Fork 15
/
NSDictionary+F.m
52 lines (40 loc) · 1.23 KB
/
NSDictionary+F.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//
// NSDictionary+F.m
// Functional
//
// Created by Hannes Walz on 07.04.12.
// Copyright 2012 leuchtetgruen. All rights reserved.
//
#import "NSDictionary+F.h"
@implementation NSDictionary(F)
- (void) each:(VoidIteratorDictBlock) block {
[F eachInDict:self withBlock:block];
}
- (NSDictionary *) map:(MapDictBlock) block {
return [F mapDict:self withBlock:block];
}
- (id) reduce:(ReduceDictBlock) block withInitialMemo:(id) memo {
return [F reduceDictionary:self withBlock:block andInitialMemo:memo];
}
- (id) filter:(BoolDictionaryBlock) block {
return [F filterDictionary:self withBlock:block];
}
- (NSDictionary*) reject:(BoolDictionaryBlock) block {
return [F rejectDictionary:self withBlock:block];
}
- (BOOL) isValidForAll:(BoolDictionaryBlock) block {
return [F allInDictionary:self withBlock:block];
}
- (BOOL) isValidForAny:(BoolDictionaryBlock) block {
return [F anyInDictionary:self withBlock:block];
}
- (NSNumber *) countValidEntries:(BoolDictionaryBlock) block {
return [F countInDictionary:self withBlock:block];
}
- (id) max:(CompareDictBlock) block {
return [F maxDict:self withBlock:block];
}
- (id) min:(CompareDictBlock) block {
return [F minDict:self withBlock:block];
}
@end