<commit_before>SwiftPlusPlus
=============

Library for common enhancements to the Swift language developed by Apple

Goals
=====

Create a common library of helpful extensions and classes that many
developers use. This would allow us to use more advanced features while maintaining
readability. You are encouraged to submit pull requests or issues with additional features
that we can discuss to see if they should be added.

Functionality Added to Swift
=============================

Optional
----------

### or

Unwrap the value returning 'defaultValue' if the value is currently nil

    var optionalString: String?
    var unwrappedString = optionalString.or("Default Value")
    println(unwrappedString) // "Default Value"

    optionalString = "Other Value"
    println(optionalString.or("Default Value")) // "Other Value"

String
----------

### repeat

Returns a string by repeating it 'times' times

    var aString = "Hello ".repeat(3)
    println(aString) // "Hello Hello Hello "

Dictionary
-----------

### map

Return a new dictionary with mapped values for each key

    var foods = [
        "fruit": ["Apple", "Cantelope", "Strawberry"],
        "meat": ["Steak", "Chicken"],
    ]

    var foodsStartingWithC = foods.map { $1.filter { $0.hasPrefix("C") } }
    println(foodsStartingWithC) // ["meat": ["Chicken"], "fruit": ["Cantelope"]]

Commit Style
=======

My commit messages follow these guidlines: [CAAG Commit Style](http://drewag.me/posts/changes-at-a-glance?source=github)<commit_msg>[CI] Added git submodule installation instructions<commit_after>SwiftPlusPlus
=============

Library for common enhancements to the Swift language developed by Apple

Goals
=====

Create a common library of helpful extensions and classes that many
developers use. This would allow us to use more advanced features while maintaining
readability. You are encouraged to submit pull requests or issues with additional features
that we can discuss to see if they should be added.

Installation
========

As git submodule
--------------

Run `git submodule add https://github.com/drewag/SwiftPlusPlus.git external/SwiftPlusPlus`
Drag 'SwiftPlusPlus.xcodeproj' into your project
Add `import SwiftPlusPlus` to the top of any file you would like to use this library in


Functionality Added to Swift
=============================

Optional
----------

### or

Unwrap the value returning 'defaultValue' if the value is currently nil

    var optionalString: String?
    var unwrappedString = optionalString.or("Default Value")
    println(unwrappedString) // "Default Value"

    optionalString = "Other Value"
    println(optionalString.or("Default Value")) // "Other Value"

String
----------

### repeat

Returns a string by repeating it 'times' times

    var aString = "Hello ".repeat(3)
    println(aString) // "Hello Hello Hello "

Dictionary
-----------

### map

Return a new dictionary with mapped values for each key and value

    var foods = [
        "fruit": ["Apple", "Cantelope", "Strawberry"],
        "meat": ["Steak", "Chicken"],
    ]

    var foodsStartingWithC = foods.map { $1.filter { $0.hasPrefix("C") } }
    println(foodsStartingWithC) // ["meat": ["Chicken"], "fruit": ["Cantelope"]]

Commit Style
=======

My commit messages follow these guidlines: [CAAG Commit Style](http://drewag.me/posts/changes-at-a-glance?source=github)
{'fraction_non_alphanumeric': 0.14438821077701697, 'fraction_numerical': 0.0017862459065197975, 'mean_word_length': 3.8, 'pattern_counts': {'":': 8, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2509828', 'n_tokens_mistral': 947, 'n_tokens_neox': 884, 'n_words': 348}