<commit_before>//
//  Box.swift
//  swiftz_core
//
//  Created by <NAME> on 6/9/14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

/// An immutable box, necessary for recursive datatypes (such as List) to avoid compiler crashes
public final class Box<T> {
	private let _value : () -> T

	public init(_ value : T) {
		self._value = { value }
	}

	public var value: T {
		return _value()
	}

	public func map<U>(f: T -> U) -> Box<U> {
		return Box<U>(f(value)) // TODO: file rdar, type inf fails without <U>
	}
}

public func <^><T, U>(f: T -> U, x: Box<T>) -> Box<U> {
	return x.map(f)
}

extension Box: Printable {
    public var description: String {
        return "Box(\(toString(value)))"
    }
}<commit_msg>Add terminating newline to Box.swift<commit_after>//
//  Box.swift
//  swiftz_core
//
//  Created by <NAME> on 6/9/14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

/// An immutable box, necessary for recursive datatypes (such as List) to avoid compiler crashes
public final class Box<T> {
	private let _value : () -> T

	public init(_ value : T) {
		self._value = { value }
	}

	public var value: T {
		return _value()
	}

	public func map<U>(f: T -> U) -> Box<U> {
		return Box<U>(f(value)) // TODO: file rdar, type inf fails without <U>
	}
}

public func <^><T, U>(f: T -> U, x: Box<T>) -> Box<U> {
	return x.map(f)
}

extension Box: Printable {
    public var description: String {
        return "Box(\(toString(value)))"
    }
}

{'fraction_non_alphanumeric': 0.16712141882673942, 'fraction_numerical': 0.010914051841746248, 'mean_word_length': 2.7906976744186047, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 35, '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': '6235817', 'n_tokens_mistral': 561, 'n_tokens_neox': 529, 'n_words': 174}