<commit_before>﻿using Xunit;
using System.Linq;
using LanguageExt.TypeClasses;
using LanguageExt.ClassInstances;
using static LanguageExt.Prelude;
using static LanguageExt.TypeClass;
using LanguageExt;

namespace LanguageExtTests
{
    public class TypeClassMonad
    {
        [Fact]
        public void MonadReturnTest()
        {
            var x = DoubleAndLift<MOption<int>, Option<int>, TInt, int>(100);
            Assert.True(x.IfNone(0) == 200);
        }

        public static MA DoubleAndLift<MONAD, MA, NUM, A>(A num)
            where MONAD : struct, Monad<MA, A>
            where NUM   : struct, Num<A> =>
            Return<MONAD, MA, A>(product<NUM, A>(num, fromInteger<NUM, A>(2)));
    }
}<commit_msg>Update TypeClassMonad.cs<commit_after>﻿using Xunit;
using System.Linq;
using LanguageExt.TypeClasses;
using LanguageExt.ClassInstances;
using static LanguageExt.Prelude;
using static LanguageExt.TypeClass;
using LanguageExt;

namespace LanguageExtTests
{
    public class TypeClassMonad
    {
        [Fact]
        public void MonadReturnTest()
        {
            Option<int> x = DoubleAndLift<MOption<int>, Option<int>, TInt, int>(100);
            Assert.True(x.IfNone(0) == 200);
        }

        public static MA DoubleAndLift<MONAD, MA, NUM, A>(A num)
            where MONAD : struct, Monad<MA, A>
            where NUM   : struct, Num<A> =>
            Return<MONAD, MA, A>(product<NUM, A>(num, fromInteger<NUM, A>(2)));
    }
}
{'fraction_non_alphanumeric': 0.11688311688311688, 'fraction_numerical': 0.010936431989063569, 'mean_word_length': 2.84251968503937, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 24, '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': '6700586', 'n_tokens_mistral': 474, 'n_tokens_neox': 458, 'n_words': 113}