Latest 1.0.2
Homepage https://github.com/mll/MLFunctionalPackage
License MIT
Platforms ios 5.0, requires ARC
Authors

A set of map-filter-reduce tools for Objective-C

Thanks to blocks Objective-C has the potential to support functional programming style.
This library provides the basic map-filter-reduce library functions to further expand this opportunity.

Installation

Use CocoaPods or copy those 2 files directly into the project.

pod 'MLFunctionalPackage'

How to use it?

See the .h file for detailed documentation.
A quick example:

#import <MLFunctionalPackage/MLFunctionalPackage.h>

NSLog(@"%@", [[[[[NSArray rangeFrom:10 to: 21] mll_filter: ^(NSNumber *n) { 
   return n.integerValue % 2 == 0; 
}] mll_map: ^(NSNumber *n) { 
   return [NSString stringWithFormat:@"%d", n.integerValue]; 
}] mll_reduce: ^(NSString *l, NSString *r) { 
   return [NSString stringWithFormat:@"%@, %@", l, r];
}] stringByAppendingString: @"."]);

Latest podspec

{
    "name": "MLFunctionalPackage",
    "version": "1.0.2",
    "summary": "A set of map-filter-reduce tools for Objective-C",
    "description": "# MLFunctionalPackagen## A set of map-filter-reduce tools for Objective-CnnThanks to blocks Objective-C has the potential to support functional programming style. nThis library provides the basic map-filter-reduce library functions to further expand this opportunity.nn## Installationn  nUse CocoaPods or copy those 2 files directly into the project. nn    pod 'MLFunctionalPackage'nn## How to use it?nn    #import n    n    NSLog(@"%@", [[[[[NSArray rangeFrom:10 to: 21] mll_filter: ^(NSNumber *n) { n       return n.integerValue % 2 == 0; n    }] mll_map: ^(NSNumber *n) { n       return [NSString stringWithFormat:@"%d", n.integerValue]; n    }] mll_reduce: ^(NSString *l, NSString *r) { n       return [NSString stringWithFormat:@"%@, %@", l, r];n    }] stringByAppendingString: @"."]);",
    "homepage": "https://github.com/mll/MLFunctionalPackage",
    "license": "MIT",
    "authors": {
        "Marek Lipert": "[email protected]"
    },
    "platforms": {
        "ios": "5.0"
    },
    "source": {
        "git": "https://github.com/mll/MLFunctionalPackage.git",
        "tag": "1.0.2"
    },
    "source_files": "*.{h,m}",
    "requires_arc": true
}

Pin It on Pinterest

Share This