<commit_before>﻿[<AutoOpen>]
module Prelude

type Result<'a, 'b> =
    | Err of 'a
    | Ok of 'b

let bind binder res =
    match res with
    | Ok v -> binder v
    | Err e -> Err e

let returnM = Ok

type ResultBuilder() =
    member __.Bind(m, f) = bind f m
    member __.Return(v) = returnM v

let result = ResultBuilder()

module Result =

    let succeed = Ok

    let fail = Err

    let map mapping res =
        match res with
        | Ok v -> Ok (mapping v)
        | Err e -> Err e

    let bind = bind

    let map2 mapping res1 res2 = result {
        let! a = res1
        let! b = res2
        return mapping a b
    }

    let map3 mapping res1 res2 res3 = result {
        let! a = res1
        let! b = res2
        let! c = res3<commit_msg>make bind and returnM private<commit_after>﻿[<AutoOpen>]
module Prelude

type Result<'a, 'b> =
    | Err of 'a
    | Ok of 'b

let private bind binder res =
    match res with
    | Ok v -> binder v
    | Err e -> Err e

let private returnM = Ok

type ResultBuilder() =
    member __.Bind(m, f) = bind f m
    member __.Return(v) = returnM v

let result = ResultBuilder()

module Result =

    let succeed = Ok

    let fail = Err

    let map mapping res =
        match res with
        | Ok v -> Ok (mapping v)
        | Err e -> Err e

    let bind = bind

    let map2 mapping res1 res2 = result {
        let! a = res1
        let! b = res2
        return mapping a b
    }

    let map3 mapping res1 res2 res3 = result {
        let! a = res1
        let! b = res2
        let! c = res3
{'fraction_non_alphanumeric': 0.0888030888030888, 'fraction_numerical': 0.015444015444015444, 'mean_word_length': 1.7328646748681897, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, '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': '224733', 'n_tokens_mistral': 530, 'n_tokens_neox': 515, 'n_words': 213}