<commit_before>//  Copyright (c) 2015 <NAME>. All rights reserved.

/// Parses the concatenation of `left` and `right`, pairing their parse trees.
public func ++ <C: CollectionType, T, U> (left: Parser<C, T>.Function, right: Parser<C, U>.Function) -> Parser<C, (T, U)>.Function {
	return left >>- { x in right --> { y in (x, y) } }
}

/// Parses the concatenation of `left` and `right`, dropping `right`’s parse tree.
public func ++ <C: CollectionType, T> (left: Parser<C, T>.Function, right: Parser<C, Ignore>.Function) -> Parser<C, T>.Function {
	return concatenate(left, right) --> { x, _ in x }
}

/// Parses the concatenation of `left` and `right`, dropping `left`’s parse tree.
public func ++ <C: CollectionType, T> (left: Parser<C, Ignore>.Function, right: Parser<C, T>.Function) -> Parser<C, T>.Function {
	return left >>- const(right)
}

/// Parses the concatenation of `left` and `right, dropping both parse trees.
public func ++ <C: CollectionType> (left: Parser<C, Ignore>.Function, right: Parser<C, Ignore>.Function) -> Parser<C, Ignore>.Function {
	return ignore(left >>- const(right))
}


// MARK: - Operators

/// Concatenation operator.
infix operator ++ {
	/// Associates to the right, linked-list style.
	associativity right

	/// Higher precedence than |.
	precedence 160
}


// MARK: - Private

/// Defines concatenation for use in the `++` operator definitions above.
private func concatenate<C: CollectionType, T, U>(left: Parser<C, T>.Function, right: Parser<C, U>.Function) -> Parser<C, (T, U)>.Function {
	return left >>- { x in
		right --> { y in (x, y) }
	}
}


// MARK: - Imports

import Prelude
<commit_msg>Implement right-ignored ++ directly.<commit_after>//  Copyright (c) 2015 <NAME>. All rights reserved.

/// Parses the concatenation of `left` and `right`, pairing their parse trees.
public func ++ <C: CollectionType, T, U> (left: Parser<C, T>.Function, right: Parser<C, U>.Function) -> Parser<C, (T, U)>.Function {
	return left >>- { x in right --> { y in (x, y) } }
}

/// Parses the concatenation of `left` and `right`, dropping `right`’s parse tree.
public func ++ <C: CollectionType, T> (left: Parser<C, T>.Function, right: Parser<C, Ignore>.Function) -> Parser<C, T>.Function {
	return left >>- { x in right --> { _, _, _ in x } }
}

/// Parses the concatenation of `left` and `right`, dropping `left`’s parse tree.
public func ++ <C: CollectionType, T> (left: Parser<C, Ignore>.Function, right: Parser<C, T>.Function) -> Parser<C, T>.Function {
	return left >>- const(right)
}

/// Parses the concatenation of `left` and `right, dropping both parse trees.
public func ++ <C: CollectionType> (left: Parser<C, Ignore>.Function, right: Parser<C, Ignore>.Function) -> Parser<C, Ignore>.Function {
	return ignore(left >>- const(right))
}


// MARK: - Operators

/// Concatenation operator.
infix operator ++ {
	/// Associates to the right, linked-list style.
	associativity right

	/// Higher precedence than |.
	precedence 160
}


// MARK: - Private

/// Defines concatenation for use in the `++` operator definitions above.
private func concatenate<C: CollectionType, T, U>(left: Parser<C, T>.Function, right: Parser<C, U>.Function) -> Parser<C, (T, U)>.Function {
	return left >>- { x in
		right --> { y in (x, y) }
	}
}


// MARK: - Imports

import Prelude

{'fraction_non_alphanumeric': 0.17065777508335858, 'fraction_numerical': 0.004243710215216732, 'mean_word_length': 3.734576757532281, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 79, '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': '5495319', 'n_tokens_mistral': 1153, 'n_tokens_neox': 1100, 'n_words': 369}