<commit_before>//
//  PrimitiveRecursion.swift
//  RecursiveMemoize
//
//  Created by <NAME> on 24/04/2015.
//  Copyright (c) 2015 bluetatami. All rights reserved.
//

func rho<T, P: Primable,R where T == P.ArgType>(f: T -> R, g: (P,R) -> R)(_ input: P) -> R {
    if input.isBase {
        return f(input.arguments)
    } else {
        return g(input, rho(f, g)(input.predecessor()))
    }
}<commit_msg>rho is now public<commit_after>//
//  PrimitiveRecursion.swift
//  RecursiveMemoize
//
//  Created by <NAME> on 24/04/2015.
//  Copyright (c) 2015 bluetatami. All rights reserved.
//

public func rho<T, P: Primable,R where T == P.ArgType>(f: T -> R, g: (P,R) -> R)(_ input: P) -> R {
    if input.isBase {
        return f(input.arguments)
    } else {
        return g(input, rho(f, g)(input.predecessor()))
    }
}
{'fraction_non_alphanumeric': 0.17783191230207065, 'fraction_numerical': 0.029232643118148598, 'mean_word_length': 2.5278969957081543, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, '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': '3212354', 'n_tokens_mistral': 343, 'n_tokens_neox': 317, 'n_words': 82}