pub mod Result_ {
    use super::*;
    use crate::List_::List;
    use crate::List_::empty;
    use crate::List_::singleton;
    use crate::Native_::Func1;
    use crate::Native_::Func2;
    use crate::NativeArray_::Array;
    use crate::NativeArray_::new_array;
    use crate::NativeArray_::new_empty;
    pub fn map<_a: Clone + 'static, _b: Clone + 'static, _c: Clone + 'static>(
        mapping: Func1<_a, _b>,
        result: Result<_a, _c>,
    ) -> Result<_b, _c> {
        match &result {
            Err(result_1_0) => Err::<_b, _c>(result_1_0.clone()),
            Ok(result_0_0) => Ok::<_b, _c>(mapping(result_0_0.clone())),
        }
    }
    pub fn mapError<_a: Clone + 'static, _b: Clone + 'static, _c: Clone + 'static>(
        mapping: Func1<_a, _b>,
        result: Result<_c, _a>,
    ) -> Result<_c, _b> {
        match &result {
            Err(result_1_0) => Err::<_c, _b>(mapping(result_1_0.clone())),
            Ok(result_0_0) => Ok::<_c, _b>(result_0_0.clone()),
        }
    }
    pub fn bind<_a: Clone + 'static, _b: Clone + 'static, _c: Clone + 'static>(
        binder: Func1<_a, Result<_b, _c>>,
        result: Result<_a, _c>,
    ) -> Result<_b, _c> {
        match &result {
            Err(result_1_0) => Err::<_b, _c>(result_1_0.clone()),
            Ok(result_0_0) => binder(result_0_0.clone()),
        }
    }
    pub fn isOk<_a: Clone + 'static, _b: Clone + 'static>(result: Result<_a, _b>) -> bool {
        match &result {
            Ok(result_0_0) => true,
            _ => false,
        }
    }
    pub fn isError<_a: Clone + 'static, _b: Clone + 'static>(result: Result<_a, _b>) -> bool {
        match &result {
            Ok(result_0_0) => false,
            _ => true,
        }
    }
    pub fn contains<_a: core::hash::Hash + PartialEq + Clone + 'static, _b: Clone + 'static>(
        value: _a,
        result: Result<_a, _b>,
    ) -> bool {
        match &result {
            Ok(result_0_0) => (result_0_0.clone()) == (value.clone()),
            _ => false,
        }
    }
    pub fn count<_a: Clone + 'static, _b: Clone + 'static>(result: Result<_a, _b>) -> i32 {
        match &result {
            Ok(result_0_0) => 1_i32,
            _ => 0_i32,
        }
    }
    pub fn defaultValue<_a: Clone + 'static, _b: Clone + 'static>(
        defaultValue_1: _a,
        result: Result<_a, _b>,
    ) -> _a {
        match &result {
            Ok(result_0_0) => result_0_0.clone(),
            _ => defaultValue_1.clone(),
        }
    }
    pub fn defaultWith<_a: Clone + 'static, _b: Clone + 'static>(
        defThunk: Func1<_a, _b>,
        result: Result<_b, _a>,
    ) -> _b {
        match &result {
            Ok(result_0_0) => result_0_0.clone(),
            Err(result_1_0) => defThunk(result_1_0.clone()),
        }
    }
    pub fn exists<_a: Clone + 'static, _b: Clone + 'static>(
        predicate: Func1<_a, bool>,
        result: Result<_a, _b>,
    ) -> bool {
        match &result {
            Ok(result_0_0) => predicate(result_0_0.clone()),
            _ => false,
        }
    }
    pub fn fold<_a: Clone + 'static, _b: Clone + 'static, _c: Clone + 'static>(
        folder: Func2<_a, _b, _a>,
        state: _a,
        result: Result<_b, _c>,
    ) -> _a {
        match &result {
            Ok(result_0_0) => folder(state.clone(), result_0_0.clone()),
            _ => state.clone(),
        }
    }
    pub fn foldBack<_a: Clone + 'static, _b: Clone + 'static, _c: Clone + 'static>(
        folder: Func2<_a, _b, _b>,
        result: Result<_a, _c>,
        state: _b,
    ) -> _b {
        match &result {
            Ok(result_0_0) => folder(result_0_0.clone(), state.clone()),
            _ => state.clone(),
        }
    }
    pub fn forAll<_a: Clone + 'static, _b: Clone + 'static>(
        predicate: Func1<_a, bool>,
        result: Result<_a, _b>,
    ) -> bool {
        match &result {
            Ok(result_0_0) => predicate(result_0_0.clone()),
            _ => true,
        }
    }
    pub fn iterate<_a: Clone + 'static, _b: Clone + 'static>(
        action: Func1<_a, ()>,
        result: Result<_a, _b>,
    ) {
        match &result {
            Ok(result_0_0) => action(result_0_0.clone()),
            _ => (),
        };
    }
    pub fn toArray<_a: Clone + 'static, _b: Clone + 'static>(result: Result<_a, _b>) -> Array<_a> {
        match &result {
            Ok(result_0_0) => new_array(&[result_0_0.clone()]),
            _ => new_empty::<_a>(),
        }
    }
    pub fn toList<_a: Clone + 'static, _b: Clone + 'static>(result: Result<_a, _b>) -> List<_a> {
        match &result {
            Ok(result_0_0) => singleton(result_0_0.clone()),
            _ => empty::<_a>(),
        }
    }
    pub fn toOption<_a: Clone + 'static, _b: Clone + 'static>(
        result: Result<_a, _b>,
    ) -> Option<_a> {
        match &result {
            Ok(result_0_0) => Some(result_0_0.clone()),
            _ => None::<_a>,
        }
    }
    pub fn toValueOption<_a: Clone + 'static, _b: Clone + 'static>(
        result: Result<_a, _b>,
    ) -> Option<_a> {
        match &result {
            Ok(result_0_0) => Some(result_0_0.clone()),
            _ => None::<_a>,
        }
    }
}
