<commit_before>import LlamaKit

func >>-<A, B>(a: Result<A>, f: A -> Result<B>) -> Result<B> {
    switch a {
    case let .Success(box): return f(box.unbox)
    case let .Failure(err): return failure(err)
    }
}

func <*><A, B>(f: Result<A -> B>, a: Result<A>) -> Result<B> {
    switch (f, a) {
    case let (.Success(fBox), .Success(aBox)): return success(fBox.unbox(aBox.unbox))
    case let (.Failure(err), _): return failure(err)
    case let (_, .Failure(err)): return failure(err)
    default: return failure(NSError())
    }
}

func <^><A, B>(f: A -> B, a: Result<A>) -> Result<B> {
    switch a {
    case let .Success(box): return success(f(box.unbox))
    case let .Failure(err): return failure(err)
    }
}<commit_msg>Use LlamaKit's map and flatMap for fmap and bind<commit_after>import LlamaKit

func >>-<A, B>(a: Result<A>, f: A -> Result<B>) -> Result<B> {
    return a.flatMap(f)
}

func <^><A, B>(f: A -> B, a: Result<A>) -> Result<B> {
    return a.map(f)
}

func <*><A, B>(f: Result<A -> B>, a: Result<A>) -> Result<B> {
    switch (f, a) {
    case let (.Success(fBox), .Success(aBox)): return success(fBox.unbox(aBox.unbox))
    case let (.Failure(err), _): return failure(err)
    case let (_, .Failure(err)): return failure(err)
    default: return failure(NSError())
    }
}
{'fraction_non_alphanumeric': 0.2053846153846154, 'fraction_numerical': 0.0, 'mean_word_length': 3.4101694915254237, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 45, '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': '5606699', 'n_tokens_mistral': 507, 'n_tokens_neox': 495, 'n_words': 132}