<commit_before>//
//  DSL.swift
//  IDPDesign
//
//  Created by Oleksa 'trimm' Korin on 9/2/17.
//  Copyright © 2017 Oleksa 'trimm' Korin. All rights reserved.
//

/// Function, that returns lens
public typealias LensGetter<Object, Property> = () -> Lens<Object, Property>

/**
 Applies property value to lens.
 
 - returns: Style for property.
 */
public func ~ <Object, Property>(lens: Lens<Object, Property>, property: Property) -> Style<Object> {
    return Style { lens.set($0, property) }
}

/**
 Applies optional property value to lens.
 
 - note: Duplication. Swiftc fails without it.
 
 - returns: Style for property.
 */
public func ~ <Object, Property>(lens: Lens<Object, Property?>, property: Property?) -> Style<Object> {
    return Style { lens.set($0, property) }
}

/**
 Applies style to lens.
 
 - returns: Style for lens.
 */
public func ~ <Object, Property>(lens: Lens<Object, Property>, style: Style<Property>) -> Style<Object> {
    return Style {
        lens.set($0, lens.get($0) |> style)
    }
}

/**
 Applies property value to lens getter.
 
 - returns: Style for property.
 */
public func ~ <Object, Property>(lens: LensGetter<Object, Property>, property: Property) -> Style<Object> {
    return lens() ~ property
}

/**
 Applies optional property value to lens getter.
 
 - note: Duplication. Swiftc fails without it.
 
 - returns: Style for property.
 */
public func ~ <Object, Property>(lens: LensGetter<Object, Property?>, property: Property?)-> Style<Object> {
    return lens() ~ property
}

/**
 Applies style to lens getter.
 
 - returns: Style for lens.
 */
public func ~ <Object, Property>(lens: LensGetter<Object, Property>, style: Style<Property>) -> Style<Object> {
    return lens() ~ style
}

/**<commit_msg>Added array operators for future use<commit_after>//
//  DSL.swift
//  IDPDesign
//
//  Created by Oleksa 'trimm' Korin on 9/2/17.
//  Copyright © 2017 Oleksa 'trimm' Korin. All rights reserved.
//

/// Function, that returns lens
public typealias LensGetter<Object, Property> = () -> Lens<Object, Property>

/**
 Applies property value to lens.
 
 - returns: Style for property.
 */
public func ~ <Object, Property>(lens: Lens<Object, Property>, property: Property) -> Style<Object> {
    return Style { lens.set($0, property) }
}

/**
 Applies optional property value to lens.
 
 - note: Duplication. Swiftc fails without it.
 
 - returns: Style for property.
 */
public func ~ <Object, Property>(lens: Lens<Object, Property?>, property: Property?) -> Style<Object> {
    return Style { lens.set($0, property) }
}

/**
 Applies style to lens.
 
 - returns: Style for lens.
 */
public func ~ <Object, Property>(lens: Lens<Object, Property>, style: Style<Property>) -> Style<Object> {
    return Style {
        lens.set($0, lens.get($0) |> style)
    }
}

/**
 Applies styles to lens.
 
 - note: Swiftc fails to derive proper types as of Swift 4.0 without specifying the type.
 
 - returns: Style for lens.
 */
public func ~ <Object, Property>(lens: Lens<Object, Property>, styles: [Style<Property>]) -> Style<Object> {
    return lens ~ Style(styles)
}

/**
 Applies styles to lens optional.
 
 - note: Swiftc fails to derive proper types as of Swift 4.0 without specifying the type.
 
 - returns: Style for lens.
 */
public func ~ <Object, Property>(lens: Lens<Object, Property?>, styles: [Style<Property>]) -> Style<Object> {
    return lens ~ lift(Style(styles))
}

/**
 Applies property value to lens getter.
 
 - returns: Style for property.
 */
public func ~ <Object, Property>(lens: LensGetter<Object, Property>, property: Property) -> Style<Object> {
    return lens() ~ property
}

/**
 Applies optional property value to lens getter.
 
 - note: Duplication. Swiftc fails without it.
 
 - returns: Style for property.
 */
public func ~ <Object, Property>(lens: LensGetter<Object, Property?>, property: Property?)-> Style<Object> {
    return lens() ~ property
}

/**
 Applies style to lens getter.
 
 - returns: Style for lens.
 */
public func ~ <Object, Property>(lens: LensGetter<Object, Property>, style: Style<Property>) -> Style<Object> {
    return lens() ~ style
}

/**
 Applies styles to lens getter.
 
 - note: Swiftc fails to derive proper types as of Swift 4.0 without specifying the type.
 
 - returns: Style for lens.
 */
public func ~ <Object, Property>(lens: LensGetter<Object, Property>, styles: [Style<Property>]) -> Style<Object> {
    return lens() ~ styles
}

/**
 Applies styles to lens optional getter.
 
 - note: Duplication. Swiftc fails without it.
 - note: Swiftc fails to derive proper types as of Swift 4.0 without specifying the type.
 
 - returns: Style for lens.
 */
public func ~ <Object, Property>(lens: LensGetter<Object, Property?>, styles: [Style<Property>]) -> Style<Object> {
    return lens() ~ styles
}

/**
{'fraction_non_alphanumeric': 0.14143094841930118, 'fraction_numerical': 0.0066555740432612314, 'mean_word_length': 3.498596819457437, 'pattern_counts': {'":': 0, '<': 63, '<?xml version=': 0, '>': 83, 'https://': 0, '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': '1733315', 'n_tokens_mistral': 1514, 'n_tokens_neox': 1420, 'n_words': 503}