<commit_before>//
//  Foldable.swift
//  Swiftz
//
//  Created by <NAME> on 6/21/15.
//  Copyright © 2015 TypeLift. All rights reserved.
//

/// A `Foldable` type admits a way of "summarizing" its entire structure.
protocol Foldable {
	typealias A
	typealias B

	/// Summarizes the receiver right-associatively.
	func foldr(folder : A -> B -> B, _ initial : B) -> B
	
	/// Summarizes the receiver left-associatively.
	func foldl(folder : B -> A -> B, _ initial : B) -> B
	
	/// Map each element of the receiver to a monoid, and combine the results.
	func foldMap<M : Monoid>(map : A -> M) -> M
}<commit_msg>Expose foldable<commit_after>//
//  Foldable.swift
//  Swiftz
//
//  Created by <NAME> on 6/21/15.
//  Copyright © 2015 TypeLift. All rights reserved.
//

/// A `Foldable` type admits a way of "summarizing" its entire structure.
public protocol Foldable {
	typealias A
	typealias B

	/// Summarizes the receiver right-associatively.
	func foldr(folder : A -> B -> B, _ initial : B) -> B
	
	/// Summarizes the receiver left-associatively.
	func foldl(folder : B -> A -> B, _ initial : B) -> B
	
	/// Map each element of the receiver to a monoid, and combine the results.
	func foldMap<M : Monoid>(map : A -> M) -> M
}
{'fraction_non_alphanumeric': 0.1357318070318888, 'fraction_numerical': 0.014717906786590351, 'mean_word_length': 2.653731343283582, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 23, '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': '7518013', 'n_tokens_mistral': 439, 'n_tokens_neox': 405, 'n_words': 152}