Decompiled source of MirageCore v1.0.1
BepInEx/core/Mirage.Core/FSharp.Control.AsyncSeq.dll
Decompiled a month ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.ExceptionServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Threading; using System.Threading.Tasks; using <StartupCode$FSharp-Control-AsyncSeq>; using FSharp.Control; using Microsoft.FSharp.Collections; using Microsoft.FSharp.Control; using Microsoft.FSharp.Core; using Microsoft.FSharp.Core.CompilerServices; [assembly: FSharpInterfaceDataVersion(2, 0, 0)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")] [assembly: AssemblyCompany("Tomas Petricek;Don Syme;Lev Gorodinski")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCopyright("Copyright 2017")] [assembly: AssemblyDescription("Asynchronous sequences for F#")] [assembly: AssemblyFileVersion("3.2.1.0")] [assembly: AssemblyInformationalVersion("3.2.1")] [assembly: AssemblyProduct("FSharp.Control.AsyncSeq")] [assembly: AssemblyTitle("FSharp.Control.AsyncSeq")] [assembly: AssemblyVersion("3.2.1.0")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/fsprojects/FSharp.Control.AsyncSeq")] [assembly: InternalsVisibleTo("FSharp.Control.AsyncSeq.Tests")] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyVersion("3.2.1.0")] namespace FSharp.Control { [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public interface IAsyncEnumerator<T> : IDisposable { virtual FSharpAsync<FSharpOption<T>> MoveNext(); } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public interface IAsyncEnumerable<T> { virtual IAsyncEnumerator<T> GetEnumerator(); } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public sealed class AsyncSeqSrc<T> : IEquatable<AsyncSeqSrc<T>>, IStructuralEquatable { [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal FSharpRef<AsyncSeqSrcNode<T>> tail@; [CompilationMapping(/*Could not decode attribute arguments.*/)] internal FSharpRef<AsyncSeqSrcNode<T>> tail => tail@; internal AsyncSeqSrc(FSharpRef<AsyncSeqSrcNode<T>> tail) { tail@ = tail; } [CompilerGenerated] public override string ToString() { return ((FSharpFunc<AsyncSeqSrc<AsyncSeqSrc<T>>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<AsyncSeqSrc<T>, string>>((PrintfFormat<FSharpFunc<AsyncSeqSrc<T>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<AsyncSeqSrc<FSharpFunc<AsyncSeqSrc<T>, string>>, string>, Unit, string, string, AsyncSeqSrc<FSharpFunc<AsyncSeqSrc<T>, string>>>("%+A"))).Invoke((AsyncSeqSrc<AsyncSeqSrc<T>>)(object)this); } [CompilerGenerated] public sealed int GetHashCode(IEqualityComparer comp) { if (this != null) { int num = 0; return -1640531527 + (((FSharpRef<AsyncSeqSrcNode<AsyncSeqSrcNode<T>>>)(object)tail@).GetHashCode(comp) + ((num << 6) + (num >> 2))); } return 0; } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public sealed bool Equals(object obj, IEqualityComparer comp) { if (this != null) { if (obj is AsyncSeqSrc<T> asyncSeqSrc) { FSharpRef<AsyncSeqSrcNode<T>> val = tail@; FSharpRef<AsyncSeqSrcNode<T>> val2 = asyncSeqSrc.tail@; return ((FSharpRef<AsyncSeqSrcNode<AsyncSeqSrcNode<T>>>)(object)val).Equals((object)val2, comp); } return false; } return obj == null; } [CompilerGenerated] public sealed bool Equals(AsyncSeqSrc<T> obj) { if (this != null) { if (obj != null) { return HashCompare.GenericEqualityERIntrinsic<FSharpRef<AsyncSeqSrcNode<T>>>(tail@, obj.tail@); } return false; } return obj == null; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is AsyncSeqSrc<T> obj2) { return Equals(obj2); } return false; } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal class AsyncSeqSrcNode<a> { internal TaskCompletionSource<FSharpOption<Tuple<a, AsyncSeqSrcNode<a>>>> tcs@; [CompilationMapping(/*Could not decode attribute arguments.*/)] internal TaskCompletionSource<FSharpOption<Tuple<a, AsyncSeqSrcNode<a>>>> tcs => tcs@; public AsyncSeqSrcNode(TaskCompletionSource<FSharpOption<Tuple<a, AsyncSeqSrcNode<a>>>> tcs) { tcs@ = tcs; } } [Serializable] [AbstractClass] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal abstract class AsyncSeqOp<T> { public abstract virtual IAsyncEnumerable<U> ChooseAsync<U>(FSharpFunc<T, FSharpAsync<FSharpOption<U>>> P_0); [CompilationArgumentCounts(new int[] { 1, 1 })] public abstract virtual FSharpAsync<S> FoldAsync<S>(FSharpFunc<S, FSharpFunc<T, FSharpAsync<S>>> P_0, S P_1); public AsyncSeqOp() { } public virtual IAsyncEnumerable<a> MapAsync<a>(FSharpFunc<T, FSharpAsync<a>> f) { FSharpFunc<a, FSharpOption<a>> @_instance; @_instance = $AsyncSeq.MapAsync@299<a>.@_instance; FSharpFunc<FSharpAsync<a>, FSharpAsync<FSharpOption<a>>> func = new $AsyncSeq.MapAsync@299-1<a>(@_instance); return ChooseAsync(new $AsyncSeq.MapAsync@299-2<T, a>(f, func)); } public virtual FSharpAsync<Unit> IterAsync(FSharpFunc<T, FSharpAsync<Unit>> f) { return FoldAsync<Unit>((FSharpFunc<Unit, FSharpFunc<T, FSharpAsync<Unit>>>)(object)new $AsyncSeq.IterAsync@301<T>(f), null); } } [RequireQualifiedAccess] [CompilationMapping(/*Could not decode attribute arguments.*/)] public static class Seq { public static IEnumerable<T> ofAsyncSeq<T>(IAsyncEnumerable<T> source) { return AsyncSeq.toBlockingSeq(source); } } [RequireQualifiedAccess] [CompilationMapping(/*Could not decode attribute arguments.*/)] public static class AsyncSeqSrc { public static AsyncSeqSrc<T> create<T>() { return new AsyncSeqSrc<T>(new FSharpRef<AsyncSeqSrcNode<T>>(new AsyncSeqSrcNode<T>(new TaskCompletionSource<FSharpOption<Tuple<T, AsyncSeqSrcNode<T>>>>()))); } [CompilationArgumentCounts(new int[] { 1, 1 })] public static void put<T>(T item, AsyncSeqSrc<T> src) { AsyncSeq.AsyncSeqSrcImpl.put(item, src); } public static void close<T>(AsyncSeqSrc<T> src) { src.tail@.contents.tcs@.SetResult(null); } public static IAsyncEnumerable<T> toAsyncSeq<T>(AsyncSeqSrc<T> src) { return AsyncSeq.AsyncSeqSrcImpl.toAsyncSeqImpl(src.tail@.contents); } [CompilationArgumentCounts(new int[] { 1, 1 })] public static void error<T>(Exception exn, AsyncSeqSrc<T> src) { src.tail@.contents.tcs@.SetException(exn); } } [AutoOpen] [CompilationMapping(/*Could not decode attribute arguments.*/)] public static class AsyncSeqExtensions { [CompilationMapping(/*Could not decode attribute arguments.*/)] public static AsyncSeq.AsyncSeqBuilder asyncSeq => $AsyncSeq.asyncSeq@1817-1; [CompilationArgumentCounts(new int[] { 1, 2 })] public static FSharpAsync<Unit> AsyncBuilder.For<T>(FSharpAsyncBuilder x, IAsyncEnumerable<T> seq, FSharpFunc<T, FSharpAsync<Unit>> action) { return AsyncSeq.iterAsync(action, seq); } } [RequireQualifiedAccess] [CompilationMapping(/*Could not decode attribute arguments.*/)] public static class AsyncSeq { [Serializable] internal sealed class empty@375-4<T> : FSharpFunc<AsyncActivation<FSharpOption<T>>, AsyncReturn> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpOption<T> value; [CompilerGenerated] [DebuggerNonUserCode] internal empty@375-4(FSharpOption<T> value) { ((FSharpFunc<AsyncActivation<FSharpOption<AsyncActivation<FSharpOption<T>>>>, AsyncReturn>)(object)this)..ctor(); this.value = value; } public unsafe override AsyncReturn Invoke(AsyncActivation<FSharpOption<T>> ctxt) { return ((AsyncActivation<FSharpOption<FSharpOption<T>>>*)(&ctxt))->OnSuccess((FSharpOption<FSharpOption<T>>)(object)value); } } [Serializable] internal sealed class empty@375-3<T> : FSharpFunc<Unit, FSharpAsync<FSharpOption<T>>> { internal static readonly empty@375-3<T> @_instance = new empty@375-3<T>(); [CompilerGenerated] [DebuggerNonUserCode] internal empty@375-3() { ((FSharpFunc<Unit, FSharpAsync<FSharpOption<Unit>>>)(object)this)..ctor(); } public override FSharpAsync<FSharpOption<T>> Invoke(Unit unitVar) { FSharpOption<T> value = null; return AsyncPrimitives.MakeAsync<FSharpOption<T>>((FSharpFunc<AsyncActivation<FSharpOption<T>>, AsyncReturn>)new empty@375-4<T>(value)); } } [Serializable] [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal sealed class empty@374-2<T> : IAsyncEnumerator<T> { FSharpAsync<FSharpOption<T>> IAsyncEnumerator<T>.MoveNext() { return ExtraTopLevelOperators.DefaultAsyncBuilder.Delay<FSharpOption<T>>((FSharpFunc<Unit, FSharpAsync<FSharpOption<T>>>)empty@375-3<T>.@_instance); } void IDisposable.Dispose() { } } [Serializable] [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal sealed class empty@372-1<T> : IAsyncEnumerable<T> { IAsyncEnumerator<T> IAsyncEnumerable<T>.GetEnumerator() { return new empty@374-2<T>(); } } [Serializable] internal sealed class singleton@385-3<T> : FSharpFunc<AsyncActivation<FSharpOption<T>>, AsyncReturn> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpOption<T> value; [CompilerGenerated] [DebuggerNonUserCode] internal singleton@385-3(FSharpOption<T> value) { ((FSharpFunc<AsyncActivation<FSharpOption<AsyncActivation<FSharpOption<T>>>>, AsyncReturn>)(object)this)..ctor(); this.value = value; } public unsafe override AsyncReturn Invoke(AsyncActivation<FSharpOption<T>> ctxt) { return ((AsyncActivation<FSharpOption<FSharpOption<T>>>*)(&ctxt))->OnSuccess((FSharpOption<FSharpOption<T>>)(object)value); } } [Serializable] internal sealed class singleton@383-2<T> : FSharpFunc<Unit, FSharpAsync<FSharpOption<T>>> { public T v; public FSharpRef<int> state; [CompilerGenerated] [DebuggerNonUserCode] internal singleton@383-2(T v, FSharpRef<int> state) { ((FSharpFunc<Unit, FSharpAsync<FSharpOption<Unit>>>)(object)this)..ctor(); this.v = v; this.state = state; } public override FSharpAsync<FSharpOption<T>> Invoke(Unit unitVar) { bool flag = state.contents == 0; state.contents += 1; FSharpOption<T> value = ((!flag) ? null : FSharpOption<T>.Some(v)); return AsyncPrimitives.MakeAsync<FSharpOption<T>>((FSharpFunc<AsyncActivation<FSharpOption<T>>, AsyncReturn>)new singleton@385-3<T>(value)); } } [Serializable] [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal sealed class singleton@382-1<T> : IAsyncEnumerator<T> { public T v; public FSharpRef<int> state; public singleton@382-1(T v, FSharpRef<int> state) { this.v = v; this.state = state; base..ctor(); } FSharpAsync<FSharpOption<T>> IAsyncEnumerator<T>.MoveNext() { return ExtraTopLevelOperators.DefaultAsyncBuilder.Delay<FSharpOption<T>>((FSharpFunc<Unit, FSharpAsync<FSharpOption<T>>>)new singleton@383-2<T>(v, state)); } void IDisposable.Dispose() { } } [Serializable] [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal sealed class singleton@379<T> : IAsyncEnumerable<T> { public T v; public singleton@379(T v) { this.v = v; base..ctor(); } IAsyncEnumerator<T> IAsyncEnumerable<T>.GetEnumerator() { FSharpRef<int> state = new FSharpRef<int>(0); return new singleton@382-1<T>(v, state); } } [Serializable] internal sealed class bindAsync@403-4<U> : FSharpFunc<AsyncActivation<AsyncGenerator.Step<U>>, AsyncReturn> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public AsyncGenerator.Step<U> value; [CompilerGenerated] [DebuggerNonUserCode] internal bindAsync@403-4(AsyncGenerator.Step<U> value) { ((FSharpFunc<AsyncActivation<AsyncGenerator.Step<AsyncActivation<AsyncGenerator.Step<U>>>>, AsyncReturn>)(object)this)..ctor(); this.value = value; } public unsafe override AsyncReturn Invoke(AsyncActivation<AsyncGenerator.Step<U>> ctxt) { return ((AsyncActivation<AsyncGenerator.Step<AsyncGenerator.Step<U>>>*)(&ctxt))->OnSuccess((AsyncGenerator.Step<AsyncGenerator.Step<U>>)(object)value); } } [Serializable] internal sealed class bindAsync@400-3<T, U> : FSharpFunc<T, FSharpAsync<AsyncGenerator.Step<U>>> { public FSharpFunc<T, IAsyncEnumerable<U>> f; [CompilerGenerated] [DebuggerNonUserCode] internal bindAsync@400-3(FSharpFunc<T, IAsyncEnumerable<U>> f) { ((FSharpFunc<T, FSharpAsync<AsyncGenerator.Step<FSharpAsync<AsyncGenerator.Step<U>>>>>)(object)this)..ctor(); this.f = f; } public override FSharpAsync<AsyncGenerator.Step<U>> Invoke(T _arg1) { AsyncGenerator.AsyncGenerator<U> item = AsyncGenerator.generatorFromEnumerator(((FSharpFunc<T, IAsyncEnumerable<IAsyncEnumerable<U>>>)(object)f).Invoke(_arg1).GetEnumerator()); AsyncGenerator.Step<U> value = AsyncGenerator.Step<U>.NewGoto(item); return AsyncPrimitives.MakeAsync<AsyncGenerator.Step<U>>((FSharpFunc<AsyncActivation<AsyncGenerator.Step<U>>, AsyncReturn>)new bindAsync@403-4<U>(value)); } } [Serializable] internal sealed class bindAsync@399-5<U, T> : FSharpFunc<AsyncActivation<AsyncGenerator.Step<U>>, AsyncReturn> { public FSharpAsync<T> inp; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpFunc<T, FSharpAsync<AsyncGenerator.Step<U>>> binder; [CompilerGenerated] [DebuggerNonUserCode] internal bindAsync@399-5(FSharpAsync<T> inp, FSharpFunc<T, FSharpAsync<AsyncGenerator.Step<U>>> binder) { ((FSharpFunc<AsyncActivation<AsyncGenerator.Step<AsyncActivation<AsyncGenerator.Step<U>>>>, AsyncReturn>)(object)this)..ctor(); this.inp = inp; this.binder = binder; } public override AsyncReturn Invoke(AsyncActivation<AsyncGenerator.Step<U>> ctxt) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return AsyncPrimitives.Bind<AsyncGenerator.Step<U>, T>(ctxt, inp, binder); } } [Serializable] internal sealed class bindAsync@399-2<U, T> : FSharpFunc<Unit, FSharpAsync<AsyncGenerator.Step<U>>> { public FSharpFunc<T, IAsyncEnumerable<U>> f; public FSharpAsync<T> inp; [CompilerGenerated] [DebuggerNonUserCode] internal bindAsync@399-2(FSharpFunc<T, IAsyncEnumerable<U>> f, FSharpAsync<T> inp) { ((FSharpFunc<Unit, FSharpAsync<AsyncGenerator.Step<Unit>>>)(object)this)..ctor(); this.f = f; this.inp = inp; } public override FSharpAsync<AsyncGenerator.Step<U>> Invoke(Unit unitVar) { FSharpFunc<T, FSharpAsync<AsyncGenerator.Step<U>>> binder = new bindAsync@400-3<T, U>(f); return AsyncPrimitives.MakeAsync<AsyncGenerator.Step<U>>((FSharpFunc<AsyncActivation<AsyncGenerator.Step<U>>, AsyncReturn>)new bindAsync@399-5<U, T>(inp, binder)); } } [Serializable] [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal sealed class bindAsync@397-1<U, T> : AsyncGenerator.AsyncGenerator<U> { public FSharpFunc<T, IAsyncEnumerable<U>> f; public FSharpAsync<T> inp; public bindAsync@397-1(FSharpFunc<T, IAsyncEnumerable<U>> f, FSharpAsync<T> inp) { this.f = f; this.inp = inp; base..ctor(); } FSharpAsync<AsyncGenerator.Step<U>> AsyncGenerator.AsyncGenerator<U>.Apply() { return ExtraTopLevelOperators.DefaultAsyncBuilder.Delay<AsyncGenerator.Step<U>>((FSharpFunc<Unit, FSharpAsync<AsyncGenerator.Step<U>>>)new bindAsync@399-2<U, T>(f, inp)); } FSharpOption<FSharpFunc<Unit, Unit>> AsyncGenerator.AsyncGenerator<U>.get_Disposer() { return null; } } [Serializable] [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal sealed class bindAsync@395<U, T> : IAsyncEnumerable<U> { public FSharpFunc<T, IAsyncEnumerable<U>> f; public FSharpAsync<T> inp; public bindAsync@395(FSharpFunc<T, IAsyncEnumerable<U>> f, FSharpAsync<T> inp) { this.f = f; this.inp = inp; base..ctor(); } IAsyncEnumerator<U> IAsyncEnumerable<U>.GetEnumerator() { return AsyncGenerator.enumeratorFromGenerator(new bindAsync@397-1<U, T>(f, inp)); } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class AsyncSeqBuilder { public IAsyncEnumerable<T> Yield<T>(T value) { return singleton(value); } internal IAsyncEnumerable<a> Return<a>() { return empty<a>(); } public IAsyncEnumerable<T> YieldFrom<T>(IAsyncEnumerable<T> source) { return source; } public IAsyncEnumerable<T> Zero<T>() { return empty<T>(); } public IAsyncEnumerable<U> Bind<T, U>(FSharpAsync<T> source, FSharpFunc<T, IAsyncEnumerable<U>> body) { return bindAsync<T, U>(body, source); } public IAsyncEnumerable<T> Combine<T>(IAsyncEnumerable<T> seq1, IAsyncEnumerable<T> seq2) { return AsyncGenerator.append(seq1, seq2); } public IAsyncEnumerable<T> While<T>(FSharpFunc<Unit, bool> guard, IAsyncEnumerable<T> body) { Lazy<IAsyncEnumerable<T>> fix = default(Lazy<IAsyncEnumerable<T>>); FSharpFunc<Unit, IAsyncEnumerable<T>> val = new While@430<T>(guard, body, fix); fix = LazyExtensions.Create<IAsyncEnumerable<T>>(val); ((While@430<T>)val).fix = fix; return fix.Value; } public IAsyncEnumerable<T> Delay<T>(FSharpFunc<Unit, IAsyncEnumerable<T>> f) { return AsyncGenerator.delay<T>(f); } public IAsyncEnumerable<T> TryFinally<T>(IAsyncEnumerable<T> body, FSharpFunc<Unit, Unit> compensation) { return tryFinally(body, compensation); } public IAsyncEnumerable<T> TryWith<T>(IAsyncEnumerable<T> body, FSharpFunc<Exception, IAsyncEnumerable<T>> handler) { return tryWith(body, handler); } public IAsyncEnumerable<U> Using<T, U>(T resource, FSharpFunc<T, IAsyncEnumerable<U>> binder) where T : IDisposable { return tryFinally(binder.Invoke(resource), new Using@721<T>(resource)); } public IAsyncEnumerable<TResult> For<T, TResult>(IEnumerable<T> source, FSharpFunc<T, IAsyncEnumerable<TResult>> action) { return collectSeq<T, TResult>(action, source); } public IAsyncEnumerable<TResult> For<T, TResult>(IAsyncEnumerable<T> source, FSharpFunc<T, IAsyncEnumerable<TResult>> action) { return collect<T, TResult>(action, source); } } [Serializable] internal sealed class While@430-1<T> : FSharpFunc<Unit, IAsyncEnumerable<T>> { public FSharpFunc<Unit, bool> guard; public IAsyncEnumerable<T> body; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public Lazy<IAsyncEnumerable<T>> fix; [CompilerGenerated] [DebuggerNonUserCode] internal While@430-1(FSharpFunc<Unit, bool> guard, IAsyncEnumerable<T> body, Lazy<IAsyncEnumerable<T>> fix) { ((FSharpFunc<Unit, IAsyncEnumerable<Unit>>)(object)this)..ctor(); this.guard = guard; this.body = body; this.fix = fix; } public override IAsyncEnumerable<T> Invoke(Unit unitVar0) { if (guard.Invoke((Unit)null)) { return AsyncGenerator.append(body, fix.Value); } return empty<T>(); } } [Serializable] internal sealed class While@430<T> : FSharpFunc<Unit, IAsyncEnumerable<T>> { public FSharpFunc<Unit, bool> guard; public IAsyncEnumerable<T> body; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public Lazy<IAsyncEnumerable<T>> fix; [CompilerGenerated] [DebuggerNonUserCode] internal While@430(FSharpFunc<Unit, bool> guard, IAsyncEnumerable<T> body, Lazy<IAsyncEnumerable<T>> fix) { ((FSharpFunc<Unit, IAsyncEnumerable<Unit>>)(object)this)..ctor(); this.guard = guard; this.body = body; this.fix = fix; } public override IAsyncEnumerable<T> Invoke(Unit unitVar) { return AsyncGenerator.delay(new While@430-1<T>(guard, body, fix)); } } [Serializable] internal sealed class emitEnumerator@442-2<T> : FSharpFunc<Unit, bool> { public FSharpRef<FSharpOption<T>> b; [CompilerGenerated] [DebuggerNonUserCode] internal emitEnumerator@442-2(FSharpRef<FSharpOption<T>> b) { this.b = b; } public override bool Invoke(Unit unitVar) { return ((FSharpRef<FSharpOption<FSharpOption<T>>>)(object)b).contents != null; } } [Serializable] internal sealed class emitEnumerator@445-5<T> : FSharpFunc<FSharpOption<T>, IAsyncEnumerable<T>> { public FSharpRef<FSharpOption<T>> b; [CompilerGenerated] [DebuggerNonUserCode] internal emitEnumerator@445-5(FSharpRef<FSharpOption<T>> b) { ((FSharpFunc<FSharpOption<FSharpOption<T>>, IAsyncEnumerable<FSharpOption<T>>>)(object)this)..ctor(); this.b = b; } public override IAsyncEnumerable<T> Invoke(FSharpOption<T> _arg2) { ((FSharpRef<FSharpOption<FSharpOption<T>>>)(object)b).contents = (FSharpOption<FSharpOption<T>>)(object)_arg2; return empty<T>(); } } [Serializable] internal sealed class emitEnumerator@444-4<T> : FSharpFunc<Unit, IAsyncEnumerable<T>> { public IAsyncEnumerator<T> ie; public FSharpRef<FSharpOption<T>> b; [CompilerGenerated] [DebuggerNonUserCode] internal emitEnumerator@444-4(IAsyncEnumerator<T> ie, FSharpRef<FSharpOption<T>> b) { ((FSharpFunc<Unit, IAsyncEnumerable<Unit>>)(object)this)..ctor(); this.ie = ie; this.b = b; } public override IAsyncEnumerable<T> Invoke(Unit unitVar) { return bindAsync(new emitEnumerator@445-5<T>(b), ie.MoveNext()); } } [Serializable] internal sealed class emitEnumerator@443-3<T> : FSharpFunc<Unit, IAsyncEnumerable<T>> { public IAsyncEnumerator<T> ie; public FSharpRef<FSharpOption<T>> b; [CompilerGenerated] [DebuggerNonUserCode] internal emitEnumerator@443-3(IAsyncEnumerator<T> ie, FSharpRef<FSharpOption<T>> b) { ((FSharpFunc<Unit, IAsyncEnumerable<Unit>>)(object)this)..ctor(); this.ie = ie; this.b = b; } public override IAsyncEnumerable<T> Invoke(Unit unitVar) { return AsyncGenerator.append(singleton(((FSharpRef<FSharpOption<FSharpOption<T>>>)(object)b).contents.Value), AsyncGenerator.delay(new emitEnumerator@444-4<T>(ie, b))); } } [Serializable] internal sealed class emitEnumerator@441-1<T> : FSharpFunc<FSharpOption<T>, IAsyncEnumerable<T>> { public IAsyncEnumerator<T> ie; [CompilerGenerated] [DebuggerNonUserCode] internal emitEnumerator@441-1(IAsyncEnumerator<T> ie) { ((FSharpFunc<FSharpOption<FSharpOption<T>>, IAsyncEnumerable<FSharpOption<T>>>)(object)this)..ctor(); this.ie = ie; } public override IAsyncEnumerable<T> Invoke(FSharpOption<T> _arg1) { FSharpRef<FSharpOption<T>> b = (FSharpRef<FSharpOption<T>>)(object)new FSharpRef<FSharpOption<FSharpOption<T>>>((FSharpOption<FSharpOption<T>>)(object)_arg1); return asyncSeq.While(new emitEnumerator@442-2<T>(b), AsyncGenerator.delay(new emitEnumerator@443-3<T>(ie, b))); } } [Serializable] internal sealed class emitEnumerator@440<T> : FSharpFunc<Unit, IAsyncEnumerable<T>> { public IAsyncEnumerator<T> ie; [CompilerGenerated] [DebuggerNonUserCode] internal emitEnumerator@440(IAsyncEnumerator<T> ie) { ((FSharpFunc<Unit, IAsyncEnumerable<Unit>>)(object)this)..ctor(); this.ie = ie; } public override IAsyncEnumerable<T> Invoke(Unit unitVar) { return bindAsync(new emitEnumerator@441-1<T>(ie), ie.MoveNext()); } } [Serializable] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [RequireQualifiedAccess] [DebuggerDisplay("{__DebugDisplay(),nq}")] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal class TryWithState<T> : IEquatable<TryWithState<T>>, IStructuralEquatable { internal static class Tags { public const int NotStarted = 0; public const int HaveBodyEnumerator = 1; public const int HaveHandlerEnumerator = 2; public const int Finished = 3; } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(TryWithState<>.NotStarted@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] internal class NotStarted : TryWithState<T> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly IAsyncEnumerable<T> item; [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] internal IAsyncEnumerable<T> Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [CompilerGenerated] [DebuggerNonUserCode] internal NotStarted(IAsyncEnumerable<T> item) : base(0) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(TryWithState<>.HaveBodyEnumerator@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] internal class HaveBodyEnumerator : TryWithState<T> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly IAsyncEnumerator<T> item; [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] internal IAsyncEnumerator<T> Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [CompilerGenerated] [DebuggerNonUserCode] internal HaveBodyEnumerator(IAsyncEnumerator<T> item) : base(1) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(TryWithState<>.HaveHandlerEnumerator@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] internal class HaveHandlerEnumerator : TryWithState<T> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly IAsyncEnumerator<T> item; [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] internal IAsyncEnumerator<T> Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [CompilerGenerated] [DebuggerNonUserCode] internal HaveHandlerEnumerator(IAsyncEnumerator<T> item) : base(2) { this.item = item; } } [SpecialName] internal class NotStarted@DebugTypeProxy { [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public IAsyncEnumerable<T> Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [CompilerGenerated] [DebuggerNonUserCode] public NotStarted@DebugTypeProxy(NotStarted obj) { _obj = obj; } } [SpecialName] internal class HaveBodyEnumerator@DebugTypeProxy { [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public IAsyncEnumerator<T> Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [CompilerGenerated] [DebuggerNonUserCode] public HaveBodyEnumerator@DebugTypeProxy(HaveBodyEnumerator obj) { _obj = obj; } } [SpecialName] internal class HaveHandlerEnumerator@DebugTypeProxy { [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public IAsyncEnumerator<T> Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [CompilerGenerated] [DebuggerNonUserCode] public HaveHandlerEnumerator@DebugTypeProxy(HaveHandlerEnumerator obj) { _obj = obj; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal int Tag { [DebuggerNonUserCode] get; } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool IsNotStarted { [CompilerGenerated] [DebuggerNonUserCode] get { return Tag == 0; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool IsHaveBodyEnumerator { [CompilerGenerated] [DebuggerNonUserCode] get { return Tag == 1; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool IsHaveHandlerEnumerator { [CompilerGenerated] [DebuggerNonUserCode] get { return Tag == 2; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal static TryWithState<T> Finished { [CompilationMapping(/*Could not decode attribute arguments.*/)] get { return _unique_Finished; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool IsFinished { [CompilerGenerated] [DebuggerNonUserCode] get { return Tag == 3; } } static TryWithState() { _unique_Finished = new TryWithState<T>(3); } [CompilerGenerated] [DebuggerNonUserCode] internal TryWithState(int _tag) { this._tag = _tag; } [CompilationMapping(/*Could not decode attribute arguments.*/)] internal static TryWithState<T> NewNotStarted(IAsyncEnumerable<T> item) { return new NotStarted(item); } [CompilationMapping(/*Could not decode attribute arguments.*/)] internal static TryWithState<T> NewHaveBodyEnumerator(IAsyncEnumerator<T> item) { return new HaveBodyEnumerator(item); } [CompilationMapping(/*Could not decode attribute arguments.*/)] internal static TryWithState<T> NewHaveHandlerEnumerator(IAsyncEnumerator<T> item) { return new HaveHandlerEnumerator(item); } [SpecialName] [CompilerGenerated] [DebuggerNonUserCode] internal object __DebugDisplay() { return ((FSharpFunc<TryWithState<TryWithState<T>>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<TryWithState<T>, string>>((PrintfFormat<FSharpFunc<TryWithState<T>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<TryWithState<FSharpFunc<TryWithState<T>, string>>, string>, Unit, string, string, string>("%+0.8A"))).Invoke((TryWithState<TryWithState<T>>)(object)this); } [CompilerGenerated] public override string ToString() { return ((FSharpFunc<TryWithState<TryWithState<T>>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<TryWithState<T>, string>>((PrintfFormat<FSharpFunc<TryWithState<T>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<TryWithState<FSharpFunc<TryWithState<T>, string>>, string>, Unit, string, string, TryWithState<FSharpFunc<TryWithState<T>, string>>>("%+A"))).Invoke((TryWithState<TryWithState<T>>)(object)this); } [CompilerGenerated] public virtual sealed int GetHashCode(IEqualityComparer comp) { if (this != null) { int num = 0; switch (Tag) { default: return _tag; case 0: { NotStarted notStarted = (NotStarted)this; num = 0; return -1640531527 + (HashCompare.GenericHashWithComparerIntrinsic<IAsyncEnumerable<T>>(comp, notStarted.item) + ((num << 6) + (num >> 2))); } case 1: { HaveBodyEnumerator haveBodyEnumerator = (HaveBodyEnumerator)this; num = 1; return -1640531527 + (HashCompare.GenericHashWithComparerIntrinsic<IAsyncEnumerator<T>>(comp, haveBodyEnumerator.item) + ((num << 6) + (num >> 2))); } case 2: { HaveHandlerEnumerator haveHandlerEnumerator = (HaveHandlerEnumerator)this; num = 2; return -1640531527 + (HashCompare.GenericHashWithComparerIntrinsic<IAsyncEnumerator<T>>(comp, haveHandlerEnumerator.item) + ((num << 6) + (num >> 2))); } } } return 0; } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public virtual sealed bool Equals(object obj, IEqualityComparer comp) { if (this != null) { if (obj is TryWithState<T> tryWithState) { int tag = _tag; int tag2 = tryWithState._tag; if (tag == tag2) { switch (Tag) { default: return true; case 0: { NotStarted notStarted = (NotStarted)this; NotStarted notStarted2 = (NotStarted)tryWithState; return HashCompare.GenericEqualityWithComparerIntrinsic<IAsyncEnumerable<T>>(comp, notStarted.item, notStarted2.item); } case 1: { HaveBodyEnumerator haveBodyEnumerator = (HaveBodyEnumerator)this; HaveBodyEnumerator haveBodyEnumerator2 = (HaveBodyEnumerator)tryWithState; return HashCompare.GenericEqualityWithComparerIntrinsic<IAsyncEnumerator<T>>(comp, haveBodyEnumerator.item, haveBodyEnumerator2.item); } case 2: { HaveHandlerEnumerator haveHandlerEnumerator = (HaveHandlerEnumerator)this; HaveHandlerEnumerator haveHandlerEnumerator2 = (HaveHandlerEnumerator)tryWithState; return HashCompare.GenericEqualityWithComparerIntrinsic<IAsyncEnumerator<T>>(comp, haveHandlerEnumerator.item, haveHandlerEnumerator2.item); } } } return false; } return false; } return obj == null; } [CompilerGenerated] public virtual sealed bool Equals(TryWithState<T> obj) { if (this != null) { if (obj != null) { int tag = _tag; int tag2 = obj._tag; if (tag == tag2) { switch (Tag) { default: return true; case 0: { NotStarted notStarted = (NotStarted)this; NotStarted notStarted2 = (NotStarted)obj; return HashCompare.GenericEqualityERIntrinsic<IAsyncEnumerable<T>>(notStarted.item, notStarted2.item); } case 1: { HaveBodyEnumerator haveBodyEnumerator = (HaveBodyEnumerator)this; HaveBodyEnumerator haveBodyEnumerator2 = (HaveBodyEnumerator)obj; return HashCompare.GenericEqualityERIntrinsic<IAsyncEnumerator<T>>(haveBodyEnumerator.item, haveBodyEnumerator2.item); } case 2: { HaveHandlerEnumerator haveHandlerEnumerator = (HaveHandlerEnumerator)this; HaveHandlerEnumerator haveHandlerEnumerator2 = (HaveHandlerEnumerator)obj; return HashCompare.GenericEqualityERIntrinsic<IAsyncEnumerator<T>>(haveHandlerEnumerator.item, haveHandlerEnumerator2.item); } } } return false; } return false; } return obj == null; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is TryWithState<T> obj2) { return Equals(obj2); } return false; } } [Serializable] internal sealed class tryWith@506-3<T> : FSharpFunc<AsyncActivation<FSharpOption<T>>, AsyncReturn> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpOption<T> value; [CompilerGenerated] [DebuggerNonUserCode] internal tryWith@506-3(FSharpOption<T> value) { ((FSharpFunc<AsyncActivation<FSharpOption<AsyncActivation<FSharpOption<T>>>>, AsyncReturn>)(object)this)..ctor(); this.value = value; } public unsafe override AsyncReturn Invoke(AsyncActivation<FSharpOption<T>> ctxt) { return ((AsyncActivation<FSharpOption<FSharpOption<T>>>*)(&ctxt))->OnSuccess((FSharpOption<FSharpOption<T>>)(object)value); } } [Serializable] internal sealed class tryWith@466-4<T> : FSharpFunc<Unit, FSharpAsync<Unit>> { public IAsyncEnumerable<T> inp; public FSharpRef<FSharpChoice<IAsyncEnumerator<T>, Exception>> res; [CompilerGenerated] [DebuggerNonUserCode] internal tryWith@466-4(IAsyncEnumerable<T> inp, FSharpRef<FSharpChoice<IAsyncEnumerator<T>, Exception>> res) { this.inp = inp; this.res = res; } public override FSharpAsync<Unit> Invoke(Unit unitVar) { ((FSharpRef<FSharpChoice<IAsyncEnumerator<FSharpChoice<IAsyncEnumerator<T>, Exception>>, Exception>>)(object)res).contents = (FSharpChoice<IAsyncEnumerator<FSharpChoice<IAsyncEnumerator<T>, Exception>>, Exception>)(object)FSharpChoice<IAsyncEnumerator<IAsyncEnumerator<T>>, Exception>.NewChoice1Of2((IAsyncEnumerator<IAsyncEnumerator<T>>)inp.GetEnumerator()); return ExtraTopLevelOperators.DefaultAsyncBuilder.Zero(); } } [Serializable] internal sealed class tryWith@465-6<T> : FSharpFunc<Exception, FSharpOption<FSharpAsync<Unit>>> { public FSharpRef<FSharpChoice<IAsyncEnumerator<T>, Exception>> res; [CompilerGenerated] [DebuggerNonUserCode] internal tryWith@465-6(FSharpRef<FSharpChoice<IAsyncEnumerator<T>, Exception>> res) { this.res = res; } public override FSharpOption<FSharpAsync<Unit>> Invoke(Exception edi) { return catchFunction@1<T>(res, edi); } } [Serializable] internal sealed class tryWith@465-5<T> : FSharpFunc<AsyncActivation<Unit>, AsyncReturn> { public FSharpRef<FSharpChoice<IAsyncEnumerator<T>, Exception>> res; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpAsync<Unit> computation; [CompilerGenerated] [DebuggerNonUserCode] internal tryWith@465-5(FSharpRef<FSharpChoice<IAsyncEnumerator<T>, Exception>> res, FSharpAsync<Unit> computation) { this.res = res; this.computation = computation; } public override AsyncReturn Invoke(AsyncActivation<Unit> ctxt) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return AsyncPrimitives.TryWith<Unit>(ctxt, computation, (FSharpFunc<Exception, FSharpOption<FSharpAsync<Unit>>>)new tryWith@465-6<T>(res)); } } [Serializable] internal sealed class tryWith@469-7<T> : FSharpFunc<Unit, FSharpAsync<FSharpOption<T>>> { public FSharpFunc<Exception, IAsyncEnumerable<T>> handler; public FSharpRef<TryWithState<T>> state; public IAsyncEnumerator<T> x; public FSharpRef<FSharpChoice<IAsyncEnumerator<T>, Exception>> res; [CompilerGenerated] [DebuggerNonUserCode] internal tryWith@469-7(FSharpFunc<Exception, IAsyncEnumerable<T>> handler, FSharpRef<TryWithState<T>> state, IAsyncEnumerator<T> x, FSharpRef<FSharpChoice<IAsyncEnumerator<T>, Exception>> res) { ((FSharpFunc<Unit, FSharpAsync<FSharpOption<Unit>>>)(object)this)..ctor(); this.handler = handler; this.state = state; this.x = x; this.res = res; } public override FSharpAsync<FSharpOption<T>> Invoke(Unit unitVar) { FSharpChoice<IAsyncEnumerator<T>, Exception> contents = ((FSharpRef<FSharpChoice<IAsyncEnumerator<FSharpChoice<IAsyncEnumerator<T>, Exception>>, Exception>>)(object)res).contents; IAsyncEnumerator<T> enumerator; if (contents is Choice2Of2<IAsyncEnumerator<T>, Exception>) { Choice2Of2<IAsyncEnumerator<T>, Exception> val = (Choice2Of2<IAsyncEnumerator<T>, Exception>)(object)contents; Exception item = ((Choice2Of2<IAsyncEnumerator<IAsyncEnumerator<T>>, Exception>)(object)val).Item; x.Dispose(); enumerator = ((FSharpFunc<Exception, IAsyncEnumerable<Exception>>)(object)handler).Invoke(item).GetEnumerator(); ((FSharpRef<TryWithState<TryWithState<T>>>)(object)state).contents = (TryWithState<TryWithState<T>>)(object)TryWithState<T>.NewHaveHandlerEnumerator(enumerator); return x.MoveNext(); } Choice1Of2<IAsyncEnumerator<T>, Exception> val2 = (Choice1Of2<IAsyncEnumerator<T>, Exception>)(object)contents; enumerator = ((Choice1Of2<IAsyncEnumerator<IAsyncEnumerator<T>>, Exception>)(object)val2).Item; ((FSharpRef<TryWithState<TryWithState<T>>>)(object)state).contents = (TryWithState<TryWithState<T>>)(object)TryWithState<T>.NewHaveBodyEnumerator(enumerator); return x.MoveNext(); } } [Serializable] internal sealed class tryWith@465-8<T> : FSharpFunc<Unit, FSharpAsync<FSharpOption<T>>> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpAsync<FSharpOption<T>> computation2; [CompilerGenerated] [DebuggerNonUserCode] internal tryWith@465-8(FSharpAsync<FSharpOption<T>> computation2) { ((FSharpFunc<Unit, FSharpAsync<FSharpOption<Unit>>>)(object)this)..ctor(); this.computation2 = computation2; } public override FSharpAsync<FSharpOption<T>> Invoke(Unit unitVar0) { return computation2; } } [Serializable] internal sealed class tryWith@465-9<T> : FSharpFunc<AsyncActivation<FSharpOption<T>>, AsyncReturn> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpAsync<Unit> computation1; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpFunc<Unit, FSharpAsync<FSharpOption<T>>> part2; [CompilerGenerated] [DebuggerNonUserCode] internal tryWith@465-9(FSharpAsync<Unit> computation1, FSharpFunc<Unit, FSharpAsync<FSharpOption<T>>> part2) { ((FSharpFunc<AsyncActivation<FSharpOption<AsyncActivation<FSharpOption<T>>>>, AsyncReturn>)(object)this)..ctor(); this.computation1 = computation1; this.part2 = part2; } public override AsyncReturn Invoke(AsyncActivation<FSharpOption<T>> ctxt) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return AsyncPrimitives.Bind<FSharpOption<T>, Unit>(ctxt, computation1, part2); } } [Serializable] internal sealed class tryWith@484-11<T> : FSharpFunc<FSharpOption<T>, FSharpAsync<Unit>> { public FSharpRef<FSharpChoice<FSharpOption<T>, Exception>> res; [CompilerGenerated] [DebuggerNonUserCode] internal tryWith@484-11(FSharpRef<FSharpChoice<FSharpOption<T>, Exception>> res) { ((FSharpFunc<FSharpOption<FSharpOption<T>>, FSharpAsync<Unit>>)(object)this)..ctor(); this.res = res; } public override FSharpAsync<Unit> Invoke(FSharpOption<T> _arg2) { ((FSharpRef<FSharpChoice<FSharpOption<FSharpChoice<FSharpOption<T>, Exception>>, Exception>>)(object)res).contents = (FSharpChoice<FSharpOption<FSharpChoice<FSharpOption<T>, Exception>>, Exception>)(object)FSharpChoice<FSharpOption<FSharpOption<T>>, Exception>.NewChoice1Of2((FSharpOption<FSharpOption<T>>)(object)_arg2); return ExtraTopLevelOperators.DefaultAsyncBuilder.Zero(); } } [Serializable] internal sealed class tryWith@483-12<T> : FSharpFunc<AsyncActivation<Unit>, AsyncReturn> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpAsync<FSharpOption<T>> computation; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpFunc<FSharpOption<T>, FSharpAsync<Unit>> binder; [CompilerGenerated] [DebuggerNonUserCode] internal tryWith@483-12(FSharpAsync<FSharpOption<T>> computation, FSharpFunc<FSharpOption<T>, FSharpAsync<Unit>> binder) { this.computation = computation; this.binder = binder; } public override AsyncReturn Invoke(AsyncActivation<Unit> ctxt) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return AsyncPrimitives.Bind<Unit, FSharpOption<T>>(ctxt, computation, binder); } } [Serializable] internal sealed class tryWith@483-10<T> : FSharpFunc<Unit, FSharpAsync<Unit>> { public IAsyncEnumerator<T> e; public FSharpRef<FSharpChoice<FSharpOption<T>, Exception>> res; [CompilerGenerated] [DebuggerNonUserCode] internal tryWith@483-10(IAsyncEnumerator<T> e, FSharpRef<FSharpChoice<FSharpOption<T>, Exception>> res) { this.e = e; this.res = res; } public override FSharpAsync<Unit> Invoke(Unit unitVar) { FSharpAsync<FSharpOption<T>> computation = e.MoveNext(); FSharpFunc<FSharpOption<T>, FSharpAsync<Unit>> binder = new tryWith@484-11<T>(res); return AsyncPrimitives.MakeAsync<Unit>((FSharpFunc<AsyncActivation<Unit>, AsyncReturn>)new tryWith@483-12<T>(computation, binder)); } } [Serializable] internal sealed class tryWith@482-14<T> : FSharpFunc<Exception, FSharpOption<FSharpAsync<Unit>>> { public FSharpRef<FSharpChoice<FSharpOption<T>, Exception>> res; [CompilerGenerated] [DebuggerNonUserCode] internal tryWith@482-14(FSharpRef<FSharpChoice<FSharpOption<T>, Exception>> res) { this.res = res; } public override FSharpOption<FSharpAsync<Unit>> Invoke(Exception edi) { return catchFunction@1-1<T>(res, edi); } } [Serializable] internal sealed class tryWith@482-13<T> : FSharpFunc<AsyncActivation<Unit>, AsyncReturn> { public FSharpRef<FSharpChoice<FSharpOption<T>, Exception>> res; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpAsync<Unit> computation; [CompilerGenerated] [DebuggerNonUserCode] internal tryWith@482-13(FSharpRef<FSharpChoice<FSharpOption<T>, Exception>> res, FSharpAsync<Unit> computation) { this.res = res; this.computation = computation; } public override AsyncReturn Invoke(AsyncActivation<Unit> ctxt) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return AsyncPrimitives.TryWith<Unit>(ctxt, computation, (FSharpFunc<Exception, FSharpOption<FSharpAsync<Unit>>>)new tryWith@482-14<T>(res)); } } [Serializable] internal sealed class tryWith@489-16<T> : FSharpFunc<AsyncActivation<FSharpOption<T>>, AsyncReturn> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpOption<T> value; [CompilerGenerated] [DebuggerNonUserCode] internal tryWith@489-16(FSharpOption<T> value) { ((FSharpFunc<AsyncActivation<FSharpOption<AsyncActivation<FSharpOption<T>>>>, AsyncReturn>)(object)this)..ctor(); this.value = value; } public unsafe override AsyncReturn Invoke(AsyncActivation<FSharpOption<T>> ctxt) { return ((AsyncActivation<FSharpOption<FSharpOption<T>>>*)(&ctxt))->OnSuccess((FSharpOption<FSharpOption<T>>)(object)value); } } [Serializable] internal sealed class tryWith@487-15<T> : FSharpFunc<Unit, FSharpAsync<FSharpOption<T>>> { public FSharpFunc<Exception, IAsyncEnumerable<T>> handler; public FSharpRef<TryWithState<T>> state; public IAsyncEnumerator<T> x; public FSharpRef<FSharpChoice<FSharpOption<T>, Exception>> res; [CompilerGenerated] [DebuggerNonUserCode] internal tryWith@487-15(FSharpFunc<Exception, IAsyncEnumerable<T>> handler, FSharpRef<TryWithState<T>> state, IAsyncEnumerator<T> x, FSharpRef<FSharpChoice<FSharpOption<T>, Exception>> res) { ((FSharpFunc<Unit, FSharpAsync<FSharpOption<Unit>>>)(object)this)..ctor(); this.handler = handler; this.state = state; this.x = x; this.res = res; } public override FSharpAsync<FSharpOption<T>> Invoke(Unit unitVar) { FSharpChoice<FSharpOption<T>, Exception> contents = ((FSharpRef<FSharpChoice<FSharpOption<FSharpChoice<FSharpOption<T>, Exception>>, Exception>>)(object)res).contents; if (contents is Choice2Of2<FSharpOption<T>, Exception>) { Choice2Of2<FSharpOption<T>, Exception> val = (Choice2Of2<FSharpOption<T>, Exception>)(object)contents; Exception item = ((Choice2Of2<FSharpOption<FSharpOption<T>>, Exception>)(object)val).Item; x.Dispose(); IAsyncEnumerator<T> enumerator = ((FSharpFunc<Exception, IAsyncEnumerable<Exception>>)(object)handler).Invoke(item).GetEnumerator(); ((FSharpRef<TryWithState<TryWithState<T>>>)(object)state).contents = (TryWithState<TryWithState<T>>)(object)TryWithState<T>.NewHaveHandlerEnumerator(enumerator); return x.MoveNext(); } Choice1Of2<FSharpOption<T>, Exception> val2 = (Choice1Of2<FSharpOption<T>, Exception>)(object)contents; FSharpOption<T> item2 = ((Choice1Of2<FSharpOption<FSharpOption<T>>, Exception>)(object)val2).Item; if (item2 == null) { x.Dispose(); } FSharpOption<T> value = item2; return AsyncPrimitives.MakeAsync<FSharpOption<T>>((FSharpFunc<AsyncActivation<FSharpOption<T>>, AsyncReturn>)new tryWith@489-16<T>(value)); } } [Serializable] internal sealed class tryWith@482-17<T> : FSharpFunc<Unit, FSharpAsync<FSharpOption<T>>> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpAsync<FSharpOption<T>> computation2; [CompilerGenerated] [DebuggerNonUserCode] internal tryWith@482-17(FSharpAsync<FSharpOption<T>> computation2) { ((FSharpFunc<Unit, FSharpAsync<FSharpOption<Unit>>>)(object)this)..ctor(); this.computation2 = computation2; } public override FSharpAsync<FSharpOption<T>> Invoke(Unit unitVar0) { return computation2; } } [Serializable] internal sealed class tryWith@482-18<T> : FSharpFunc<AsyncActivation<FSharpOption<T>>, AsyncReturn> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpAsync<Unit> computation1; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpFunc<Unit, FSharpAsync<FSharpOption<T>>> part2; [CompilerGenerated] [DebuggerNonUserCode] internal tryWith@482-18(FSharpAsync<Unit> computation1, FSharpFunc<Unit, FSharpAsync<FSharpOption<T>>> part2) { ((FSharpFunc<AsyncActivation<FSharpOption<AsyncActivation<FSharpOption<T>>>>, AsyncReturn>)(object)this)..ctor(); this.computation1 = computation1; this.part2 = part2; } public override AsyncReturn Invoke(AsyncActivation<FSharpOption<T>> ctxt) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return AsyncPrimitives.Bind<FSharpOption<T>, Unit>(ctxt, computation1, part2); } } [Serializable] internal sealed class tryWith@502-20<T> : FSharpFunc<AsyncActivation<FSharpOption<T>>, AsyncReturn> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpOption<T> value; [CompilerGenerated] [DebuggerNonUserCode] internal tryWith@502-20(FSharpOption<T> value) { ((FSharpFunc<AsyncActivation<FSharpOption<AsyncActivation<FSharpOption<T>>>>, AsyncReturn>)(object)this)..ctor(); this.value = value; } public unsafe override AsyncReturn Invoke(AsyncActivation<FSharpOption<T>> ctxt) { return ((AsyncActivation<FSharpOption<FSharpOption<T>>>*)(&ctxt))->OnSuccess((FSharpOption<FSharpOption<T>>)(object)value); } } [Serializable] internal sealed class tryWith@502-19<T> : FSharpFunc<FSharpOption<T>, FSharpAsync<FSharpOption<T>>> { public IAsyncEnumerator<T> x; [CompilerGenerated] [DebuggerNonUserCode] internal tryWith@502-19(IAsyncEnumerator<T> x) { ((FSharpFunc<FSharpOption<FSharpOption<T>>, FSharpAsync<FSharpOption<FSharpOption<T>>>>)(object)this)..ctor(); this.x = x; } public override FSharpAsync<FSharpOption<T>> Invoke(FSharpOption<T> _arg4) { object obj; if (_arg4 == null) { x.Dispose(); obj = null; } else { obj = _arg4; } FSharpOption<T> value = (FSharpOption<T>)obj; return AsyncPrimitives.MakeAsync<FSharpOption<T>>((FSharpFunc<AsyncActivation<FSharpOption<T>>, AsyncReturn>)new tryWith@502-20<T>(value)); } } [Serializable] internal sealed class tryWith@501-21<T> : FSharpFunc<AsyncActivation<FSharpOption<T>>, AsyncReturn> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpAsync<FSharpOption<T>> computation; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpFunc<FSharpOption<T>, FSharpAsync<FSharpOption<T>>> binder; [CompilerGenerated] [DebuggerNonUserCode] internal tryWith@501-21(FSharpAsync<FSharpOption<T>> computation, FSharpFunc<FSharpOption<T>, FSharpAsync<FSharpOption<T>>> binder) { ((FSharpFunc<AsyncActivation<FSharpOption<AsyncActivation<FSharpOption<T>>>>, AsyncReturn>)(object)this)..ctor(); this.computation = computation; this.binder = binder; } public override AsyncReturn Invoke(AsyncActivation<FSharpOption<T>> ctxt) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return AsyncPrimitives.Bind<FSharpOption<T>, FSharpOption<T>>(ctxt, computation, binder); } } [Serializable] internal sealed class tryWith@462-2<T> : FSharpFunc<Unit, FSharpAsync<FSharpOption<T>>> { public FSharpFunc<Exception, IAsyncEnumerable<T>> handler; public FSharpRef<TryWithState<T>> state; public IAsyncEnumerator<T> x; [CompilerGenerated] [DebuggerNonUserCode] internal tryWith@462-2(FSharpFunc<Exception, IAsyncEnumerable<T>> handler, FSharpRef<TryWithState<T>> state, IAsyncEnumerator<T> x) { ((FSharpFunc<Unit, FSharpAsync<FSharpOption<Unit>>>)(object)this)..ctor(); this.handler = handler; this.state = state; this.x = x; } public override FSharpAsync<FSharpOption<T>> Invoke(Unit unitVar) { TryWithState<T> contents = ((FSharpRef<TryWithState<TryWithState<T>>>)(object)state).contents; switch (contents.Tag) { default: { FSharpOption<T> value = null; return AsyncPrimitives.MakeAsync<FSharpOption<T>>((FSharpFunc<AsyncActivation<FSharpOption<T>>, AsyncReturn>)new tryWith@506-3<T>(value)); } case 0: { TryWithState<T>.NotStarted notStarted = (TryWithState<T>.NotStarted)contents; IAsyncEnumerable<T> item2 = notStarted.item; FSharpRef<FSharpChoice<IAsyncEnumerator<T>, Exception>> res2 = (FSharpRef<FSharpChoice<IAsyncEnumerator<T>, Exception>>)(object)new FSharpRef<FSharpChoice<IAsyncEnumerator<FSharpChoice<IAsyncEnumerator<T>, Exception>>, Exception>>((FSharpChoice<IAsyncEnumerator<FSharpChoice<IAsyncEnumerator<T>, Exception>>, Exception>)null); FSharpAsync<Unit> computation2 = ExtraTopLevelOperators.DefaultAsyncBuilder.Delay<Unit>((FSharpFunc<Unit, FSharpAsync<Unit>>)new tryWith@466-4<T>(item2, res2)); FSharpAsync<Unit> computation3 = AsyncPrimitives.MakeAsync<Unit>((FSharpFunc<AsyncActivation<Unit>, AsyncReturn>)new tryWith@465-5<T>(res2, computation2)); FSharpAsync<FSharpOption<T>> computation = ExtraTopLevelOperators.DefaultAsyncBuilder.Delay<FSharpOption<T>>((FSharpFunc<Unit, FSharpAsync<FSharpOption<T>>>)new tryWith@469-7<T>(handler, state, x, res2)); FSharpFunc<Unit, FSharpAsync<FSharpOption<T>>> part = new tryWith@465-8<T>(computation); return AsyncPrimitives.MakeAsync<FSharpOption<T>>((FSharpFunc<AsyncActivation<FSharpOption<T>>, AsyncReturn>)new tryWith@465-9<T>(computation3, part)); } case 1: { TryWithState<T>.HaveBodyEnumerator haveBodyEnumerator = (TryWithState<T>.HaveBodyEnumerator)contents; IAsyncEnumerator<T> item = haveBodyEnumerator.item; FSharpRef<FSharpChoice<FSharpOption<T>, Exception>> res = (FSharpRef<FSharpChoice<FSharpOption<T>, Exception>>)(object)new FSharpRef<FSharpChoice<FSharpOption<FSharpChoice<FSharpOption<T>, Exception>>, Exception>>((FSharpChoice<FSharpOption<FSharpChoice<FSharpOption<T>, Exception>>, Exception>)null); FSharpAsync<Unit> computation2 = ExtraTopLevelOperators.DefaultAsyncBuilder.Delay<Unit>((FSharpFunc<Unit, FSharpAsync<Unit>>)new tryWith@483-10<T>(item, res)); FSharpAsync<Unit> computation3 = AsyncPrimitives.MakeAsync<Unit>((FSharpFunc<AsyncActivation<Unit>, AsyncReturn>)new tryWith@482-13<T>(res, computation2)); FSharpAsync<FSharpOption<T>> computation = ExtraTopLevelOperators.DefaultAsyncBuilder.Delay<FSharpOption<T>>((FSharpFunc<Unit, FSharpAsync<FSharpOption<T>>>)new tryWith@487-15<T>(handler, state, x, res)); FSharpFunc<Unit, FSharpAsync<FSharpOption<T>>> part = new tryWith@482-17<T>(computation); return AsyncPrimitives.MakeAsync<FSharpOption<T>>((FSharpFunc<AsyncActivation<FSharpOption<T>>, AsyncReturn>)new tryWith@482-18<T>(computation3, part)); } case 2: { TryWithState<T>.HaveHandlerEnumerator haveHandlerEnumerator = (TryWithState<T>.HaveHandlerEnumerator)contents; IAsyncEnumerator<T> item = haveHandlerEnumerator.item; FSharpAsync<FSharpOption<T>> computation = item.MoveNext(); FSharpFunc<FSharpOption<T>, FSharpAsync<FSharpOption<T>>> binder = new tryWith@502-19<T>(x); return AsyncPrimitives.MakeAsync<FSharpOption<T>>((FSharpFunc<AsyncActivation<FSharpOption<T>>, AsyncReturn>)new tryWith@501-21<T>(computation, binder)); } } } } [Serializable] [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal sealed class tryWith@460-1<T> : IAsyncEnumerator<T> { public FSharpFunc<Exception, IAsyncEnumerable<T>> handler; public FSharpRef<TryWithState<T>> state; public tryWith@460-1(FSharpFunc<Exception, IAsyncEnumerable<T>> handler, FSharpRef<TryWithState<T>> state) { this.handler = handler; this.state = state; base..ctor(); } FSharpAsync<FSharpOption<T>> IAsyncEnumerator<T>.MoveNext() { return ExtraTopLevelOperators.DefaultAsyncBuilder.Delay<FSharpOption<T>>((FSharpFunc<Unit, FSharpAsync<FSharpOption<T>>>)new tryWith@462-2<T>(handler, state, this)); } void IDisposable.Dispose() { TryWithState<T> contents = ((FSharpRef<TryWithState<TryWithState<T>>>)(object)state).contents; IAsyncEnumerator<T> item; switch (contents.Tag) { default: return; case 1: item = ((TryWithState<T>.HaveBodyEnumerator)contents).item; break; case 2: item = ((TryWithState<T>.HaveHandlerEnumerator)contents).item; break; } ((FSharpRef<TryWithState<TryWithState<T>>>)(object)state).contents = (TryWithState<TryWithState<T>>)(object)TryWithState<T>.Finished; IDisposable disposable = item; try { disposable.Dispose(); Unit val = null; } catch (object obj) { Exception ex = (Exception)obj; Unit val = null; } } } [Serializable] [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal sealed class tryWith@457<T> : IAsyncEnumerable<T> { public IAsyncEnumerable<T> inp; public FSharpFunc<Exception, IAsyncEnumerable<T>> handler; public tryWith@457(IAsyncEnumerable<T> inp, FSharpFunc<Exception, IAsyncEnumerable<T>> handler) { this.inp = inp; this.handler = handler; base..ctor(); } IAsyncEnumerator<T> IAsyncEnumerable<T>.GetEnumerator() { FSharpRef<TryWithState<T>> state = (FSharpRef<TryWithState<T>>)(object)new FSharpRef<TryWithState<TryWithState<T>>>((TryWithState<TryWithState<T>>)(object)TryWithState<T>.NewNotStarted(inp)); return new tryWith@460-1<T>(handler, state); } } [Serializable] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [RequireQualifiedAccess] [DebuggerDisplay("{__DebugDisplay(),nq}")] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal abstract class TryFinallyState<T> : IEquatable<TryFinallyState<T>>, IStructuralEquatable { internal static class Tags { public const int NotStarted = 0; public const int HaveBodyEnumerator = 1; public const int Finished = 2; } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(TryFinallyState<>.NotStarted@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] internal class NotStarted : TryFinallyState<T> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly IAsyncEnumerable<T> item; [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] internal IAsyncEnumerable<T> Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [CompilerGenerated] [DebuggerNonUserCode] internal NotStarted(IAsyncEnumerable<T> item) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(TryFinallyState<>.HaveBodyEnumerator@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] internal class HaveBodyEnumerator : TryFinallyState<T> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly IAsyncEnumerator<T> item; [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] internal IAsyncEnumerator<T> Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [CompilerGenerated] [DebuggerNonUserCode] internal HaveBodyEnumerator(IAsyncEnumerator<T> item) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(TryFinallyState<>._Finished@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] internal class _Finished : TryFinallyState<T> { [CompilerGenerated] [DebuggerNonUserCode] internal _Finished() { } } [SpecialName] internal class NotStarted@DebugTypeProxy { [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public IAsyncEnumerable<T> Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [CompilerGenerated] [DebuggerNonUserCode] public NotStarted@DebugTypeProxy(NotStarted obj) { _obj = obj; } } [SpecialName] internal class HaveBodyEnumerator@DebugTypeProxy { [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public IAsyncEnumerator<T> Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [CompilerGenerated] [DebuggerNonUserCode] public HaveBodyEnumerator@DebugTypeProxy(HaveBodyEnumerator obj) { _obj = obj; } } [SpecialName] internal class _Finished@DebugTypeProxy { [CompilerGenerated] [DebuggerNonUserCode] public _Finished@DebugTypeProxy(_Finished obj) { _obj = obj; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal int Tag { [CompilerGenerated] [DebuggerNonUserCode] get { return (this is _Finished) ? 2 : ((this is HaveBodyEnumerator) ? 1 : 0); } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool IsNotStarted { [CompilerGenerated] [DebuggerNonUserCode] get { return this is NotStarted; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool IsHaveBodyEnumerator { [CompilerGenerated] [DebuggerNonUserCode] get { return this is HaveBodyEnumerator; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal static TryFinallyState<T> Finished { [CompilationMapping(/*Could not decode attribute arguments.*/)] get { return _unique_Finished; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool IsFinished { [CompilerGenerated] [DebuggerNonUserCode] get { return this is _Finished; } } static TryFinallyState() { _unique_Finished = new _Finished(); } [CompilerGenerated] [DebuggerNonUserCode] internal TryFinallyState() { } [CompilationMapping(/*Could not decode attribute arguments.*/)] internal static TryFinallyState<T> NewNotStarted(IAsyncEnumerable<T> item) { return new NotStarted(item); } [CompilationMapping(/*Could not decode attribute arguments.*/)] internal static TryFinallyState<T> NewHaveBodyEnumerator(IAsyncEnumerator<T> item) { return new HaveBodyEnumerator(item); } [SpecialName] [CompilerGenerated] [DebuggerNonUserCode] internal object __DebugDisplay() { return ((FSharpFunc<TryFinallyState<TryFinallyState<T>>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<TryFinallyState<T>, string>>((PrintfFormat<FSharpFunc<TryFinallyState<T>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<TryFinallyState<FSharpFunc<TryFinallyState<T>, string>>, string>, Unit, string, string, string>("%+0.8A"))).Invoke((TryFinallyState<TryFinallyState<T>>)(object)this); } [CompilerGenerated] public override string ToString() { return ((FSharpFunc<TryFinallyState<TryFinallyState<T>>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<TryFinallyState<T>, string>>((PrintfFormat<FSharpFunc<TryFinallyState<T>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<TryFinallyState<FSharpFunc<TryFinallyState<T>, string>>, string>, Unit, string, string, TryFinallyState<FSharpFunc<TryFinallyState<T>, string>>>("%+A"))).Invoke((TryFinallyState<TryFinallyState<T>>)(object)this); } [CompilerGenerated] public virtual sealed int GetHashCode(IEqualityComparer comp) { if (this != null) { int num = 0; if (!(this is NotStarted)) { if (!(this is HaveBodyEnumerator)) { return (this is _Finished) ? 2 : ((this is HaveBodyEnumerator) ? 1 : 0); } HaveBodyEnumerator haveBodyEnumerator = (HaveBodyEnumerator)this; num = 1; return -1640531527 + (HashCompare.GenericHashWithComparerIntrinsic<IAsyncEnumerator<T>>(comp, haveBodyEnumerator.item) + ((num << 6) + (num >> 2))); } NotStarted notStarted = (NotStarted)this; num = 0; return -1640531527 + (HashCompare.GenericHashWithComparerIntrinsic<IAsyncEnumerable<T>>(comp, notStarted.item) + ((num << 6) + (num >> 2))); } return 0; } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public virtual sealed bool Equals(object obj, IEqualityComparer comp) { if (this != null) { if (obj is TryFinallyState<T> tryFinallyState) { int num = ((this is _Finished) ? 2 : ((this is HaveBodyEnumerator) ? 1 : 0)); TryFinallyState<T> tryFinallyState2 = tryFinallyState; int num2 = ((tryFinallyState2 is _Finished) ? 2 : ((tryFinallyState2 is HaveBodyEnumerator) ? 1 : 0)); if (num == num2) { if (!(this is NotStarted)) { if (!(this is HaveBodyEnumerator)) { return true; } HaveBodyEnumerator haveBodyEnumerator = (HaveBodyEnumerator)this; HaveBodyEnumerator haveBodyEnumerator2 = (HaveBodyEnumerator)tryFinallyState; return HashCompare.GenericEqualityWithComparerIntrinsic<IAsyncEnumerator<T>>(comp, haveBodyEnumerator.item, haveBodyEnumerator2.item); } NotStarted notStarted = (NotStarted)this; NotStarted notStarted2 = (NotStarted)tryFinallyState; return HashCompare.GenericEqualityWithComparerIntrinsic<IAsyncEnumerable<T>>(comp, notStarted.item, notStarted2.item); } return false; } return false; } return obj == null; } [CompilerGenerated] public virtual sealed bool Equals(TryFinallyState<T> obj) { if (this != null) { if (obj != null) { int num = ((this is _Finished) ? 2 : ((this is HaveBodyEnumerator) ? 1 : 0)); int num2 = ((obj is _Finished) ? 2 : ((obj is HaveBodyEnumerator) ? 1 : 0)); if (num == num2) { if (!(this is NotStarted)) { if (!(this is HaveBodyEnumerator)) { return true; } HaveBodyEnumerator haveBodyEnumerator = (HaveBodyEnumerator)this; HaveBodyEnumerator haveBodyEnumerator2 = (HaveBodyEnumerator)obj; return HashCompare.GenericEqualityERIntrinsic<IAsyncEnumerator<T>>(haveBodyEnumerator.item, haveBodyEnumerator2.item); } NotStarted notStarted = (NotStarted)this; NotStarted notStarted2 = (NotStarted)obj; return HashCompare.GenericEqualityERIntrinsic<IAsyncEnumerable<T>>(notStarted.item, notStarted2.item); } return false; } return false; } return obj == null; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is TryFinallyState<T> obj2) { return Equals(obj2); } return false; } } [Serializable] internal sealed class tryFinally@543-3<T> : FSharpFunc<AsyncActivation<FSharpOption<T>>, AsyncReturn> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpOption<T> value; [CompilerGenerated] [DebuggerNonUserCode] internal tryFinally@543-3(FSharpOption<T> value) { ((FSharpFunc<AsyncActivation<FSharpOption<AsyncActivation<FSharpOption<T>>>>, AsyncReturn>)(object)this)..ctor(); this.value = value; } public unsafe override AsyncReturn Invoke(AsyncActivation<FSharpOption<T>> ctxt) { return ((AsyncActivation<FSharpOption<FSharpOption<T>>>*)(&ctxt))->OnSuccess((FSharpOption<FSharpOption<T>>)(object)value); } } [Serializable] internal sealed class tryFinally@537-5<T> : FSharpFunc<AsyncActivation<FSharpOption<T>>, AsyncReturn> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpOption<T> value; [CompilerGenerated] [DebuggerNonUserCode] internal tryFinally@537-5(FSharpOption<T> value) { ((FSharpFunc<AsyncActivation<FSharpOption<AsyncActivation<FSharpOption<T>>>>, AsyncReturn>)(object)this)..ctor(); this.value = value; } public unsafe override AsyncReturn Invoke(AsyncActivation<FSharpOption<T>> ctxt) { return ((AsyncActivation<FSharpOption<FSharpOption<T>>>*)(&ctxt))->OnSuccess((FSharpOption<FSharpOption<T>>)(object)value); } } [Serializable] internal sealed class tryFinally@537-4<T> : FSharpFunc<FSharpOption<T>, FSharpAsync<FSharpOption<T>>> { public IAsyncEnumerator<T> x; [CompilerGenerated] [DebuggerNonUserCode] internal tryFinally@537-4(IAsyncEnumerator<T> x) { ((FSharpFunc<FSharpOption<FSharpOption<T>>, FSharpAsync<FSharpOption<FSharpOption<T>>>>)(object)this)..ctor(); this.x = x; } public override FSharpAsync<FSharpOption<T>> Invoke(FSharpOption<T> _arg1) { if (_arg1 == null) { x.Dispose(); } return AsyncPrimitives.MakeAsync<FSharpOption<T>>((FSharpFunc<AsyncActivation<FSharpOption<T>>, AsyncReturn>)new tryFinally@537-5<T>(_arg1)); } } [Serializable] internal sealed class tryFinally@536-6<T> : FSharpFunc<AsyncActivation<FSharpOption<T>>, AsyncReturn> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpAsync<FSharpOption<T>> computation; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpFunc<FSharpOption<T>, FSharpAsync<FSharpOption<T>>> binder; [CompilerGenerated] [DebuggerNonUserCode] internal tryFinally@536-6(FSharpAsync<FSharpOption<T>> computation, FSharpFunc<FSharpOption<T>, FSharpAsync<FSharpOption<T>>> binder) { ((FSharpFunc<AsyncActivation<FSharpOption<AsyncActivation<FSharpOption<T>>>>, AsyncReturn>)(object)this)..ctor(); this.computation = computation; this.binder = binder; } public override AsyncReturn Invoke(AsyncActivation<FSharpOption<T>> ctxt) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return AsyncPrimitives.Bind<FSharpOption<T>, FSharpOption<T>>(ctxt, computation, binder); } } [Serializable] internal sealed class tryFinally@529-2<T> : FSharpFunc<Unit, FSharpAsync<FSharpOption<T>>> { public FSharpRef<TryFinallyState<T>> state; public IAsyncEnumerator<T> x; [CompilerGenerated] [DebuggerNonUserCode] internal tryFinally@529-2(FSharpRef<TryFinallyState<T>> state, IAsyncEnumerator<T> x) { ((FSharpFunc<Unit, FSharpAsync<FSharpOption<Unit>>>)(object)this)..ctor(); this.state = state; this.x = x; } public override FSharpAsync<FSharpOption<T>> Invoke(Unit unitVar) { TryFinallyState<T> contents = ((FSharpRef<TryFinallyState<TryFinallyState<T>>>)(object)state).contents; TryFinallyState<T> tryFinallyState = contents; IAsyncEnumerator<T> item; if (!(tryFinallyState is TryFinallyState<T>.NotStarted)) { if (!(tryFinallyState is TryFinallyState<T>.HaveBodyEnumerator)) { FSharpOption<T> value = null; return AsyncPrimitives.MakeAsync<FSharpOption<T>>((FSharpFunc<AsyncActivation<FSharpOption<T>>, AsyncReturn>)new tryFinally@543-3<T>(value)); } TryFinallyState<T>.HaveBodyEnumerator haveBodyEnumerator = (TryFinallyState<T>.HaveBodyEnumerator)contents; item = haveBodyEnumerator.item; FSharpAsync<FSharpOption<T>> computation = item.MoveNext(); FSharpFunc<FSharpOption<T>, FSharpAsync<FSharpOption<T>>> binder = new tryFinally@537-4<T>(x); return AsyncPrimitives.MakeAsync<FSharpOption<T>>((FSharpFunc<AsyncActivation<FSharpOption<T>>, AsyncReturn>)new tryFinally@536-6<T>(computation, binder)); } TryFinallyState<T>.NotStarted notStarted = (TryFinallyState<T>.NotStarted)contents; IAsyncEnumerable<T> item2 = notStarted.item; item = item2.GetEnumerator(); ((FSharpRef<TryFinallyState<TryFinallyState<T>>>)(object)state).contents = (TryFinallyState<TryFinallyState<T>>)(object)TryFinallyState<T>.NewHaveBodyEnumerator(item); return x.MoveNext(); } } [Serializable] [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal sealed class tryFinally@527-1<T> : IAsyncEnumerator<T> { public FSharpFunc<Unit, Unit> compensation; public FSharpRef<TryFinallyState<T>> state; public tryFinally@527-1(FSharpFunc<Unit, Unit> compensation, FSharpRef<TryFinallyState<T>> state) { this.compensation = compensation; this.state = state; base..ctor(); } FSharpAsync<FSharpOption<T>> IAsyncEnumerator<T>.MoveNext() { return ExtraTopLevelOperators.DefaultAsyncBuilder.Delay<FSharpOption<T>>((FSharpFunc<Unit, FSharpAsync<FSharpOption<T>>>)new tryFinally@529-2<T>(state, this)); } void IDisposable.Dispose() { TryFinallyState<T> contents = ((FSharpRef<TryFinallyState<TryFinallyState<T>>>)(object)state).contents; if (contents is TryFinallyState<T>.HaveBodyEnumerator) { TryFinallyState<T>.HaveBodyEnumerator haveBodyEnumerator = (TryFinallyState<T>.HaveBodyEnumerator)contents; IAsyncEnumerator<T> item = haveBodyEnumerator.item; ((FSharpRef<TryFinallyState<TryFinallyState<T>>>)(object)state).contents = (TryFinallyState<TryFinallyState<T>>)(object)TryFinallyState<T>.Finished; IDisposable disposable = item; try { disposable.Dispose(); Unit val = null; } catch (object obj) { Exception ex = (Exception)obj; Unit val = null; } compensation.Invoke((Unit)null); } } } [Serializable] [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal sealed class tryFinally@524<T> : IAsyncEnumerable<T> { public IAsyncEnumerable<T> inp; public FSharpFunc<Unit, Unit> compensation; public tryFinally@524(IAsyncEnumerable<T> inp, FSharpFunc<Unit, Unit> compensation) { this.inp = inp; this.compensation = compensation; base..ctor(); } IAsyncEnumerator<T> IAsyncEnumerable<T>.GetEnumerator() { FSharpRef<TryFinallyState<T>> state = (FSharpRef<TryFinallyState<T>>)(object)new FSharpRef<TryFinallyState<TryFinallyState<T>>>((TryFinallyState<TryFinallyState<T>>)(object)TryFinallyState<T>.NewNotStarted(inp)); return new tryFinally@527-1<T>(compensation, state); } } [Serializable] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [RequireQualifiedAccess] [DebuggerDisplay("{__DebugDisplay(),nq}")] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal class CollectState<T, U> : IEquatable<CollectState<T, U>>, IStructuralEquatable { internal static class Tags { public const int NotStarted = 0; public const int HaveInputEnumerator = 1; public const int HaveInnerEnumerator = 2; public const int Finished = 3; } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(CollectState<, >.NotStarted@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] internal class NotStarted : CollectState<T, U> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly IAsyncEnumerable<T> item; [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] internal IAsyncEnumerable<T> Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [CompilerGenerated] [DebuggerNonUserCode] internal NotStarted(IAsyncEnumerable<T> item) : base(0) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(CollectState<, >.HaveInputEnumerator@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] internal class HaveInputEnumerator : CollectState<T, U> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly IAsyncEnumerator<T> item; [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] internal IAsyncEnumerator<T> Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [CompilerGenerated] [DebuggerNonUserCode] internal HaveInputEnumerator(IAsyncEnumerator<T> item) : base(1) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(CollectState<, >.HaveInnerEnumerator@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] internal class HaveInnerEnumerator : CollectState<T, U> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly IAsyncEnumerator<T> item1; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly IAsyncEnumerator<U> item2; [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] internal IAsyncEnumerator<T> Item1 { [CompilerGenerated] [DebuggerNonUserCode] get { return item1; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] internal IAsyncEnumerator<U> Item2 { [CompilerGenerated] [DebuggerNonUserCode] get { return item2; } } [CompilerGenerated] [DebuggerNonUserCode] internal HaveInnerEnumerator(IAsyncEnumerator<T> item1, IAsyncEnumerator<U> item2) : base(2) { this.item1 = item1; this.item2 = item2; } } [SpecialName] internal class NotStarted@DebugTypeProxy { [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public IAsyncEnumerable<T> Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [CompilerGenerated] [DebuggerNonUserCode] public NotStarted@DebugTypeProxy(NotStarted obj) { _obj = obj; } } [SpecialName] internal class HaveInputEnumerator@DebugTypeProxy { [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public IAsyncEnumerator<T> Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [CompilerGenerated] [DebuggerNonUserCode] public HaveInputEnumerator@DebugTypeProxy(HaveInputEnumerator obj) { _obj = obj; } } [SpecialName] internal class HaveInnerEnumerator@DebugTypeProxy { [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public IAsyncEnumerator<T> Item1 { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item1; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public IAsyncEnumerator<U> Item2 { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item2; } } [CompilerGenerated] [DebuggerNonUserCode] public HaveInnerEnumerator@DebugTypeProxy(HaveInnerEnumerator obj) { _obj = obj; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal int Tag { [DebuggerNonUserCode] get; } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool IsNotStarted { [CompilerGenerated] [DebuggerNonUserCode] get { return Tag == 0; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool IsHaveInputEnumerator { [CompilerGenerated] [DebuggerNonUserCode] get { return Tag == 1; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool IsHaveInnerEnumerator { [CompilerGenerated] [DebuggerNonUserCode] get { return Tag == 2; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal static CollectState<T, U> Finished { [CompilationMapping(/*Could not decode attribute arguments.*/)] get { return _unique_Finished; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool IsFinished { [CompilerGenerated] [DebuggerNonUserCode] get { return Tag == 3; } } static CollectState() { _unique_Finished = new CollectState<T, U>(3); } [CompilerGenerated] [DebuggerNonUserCode] internal CollectState(int _tag) { this._tag = _tag; } [CompilationMapping(/*Could not decode attribute arguments.*/)] internal static CollectState<T, U> NewNotStarted(IAsyncEnumerable<T> item) { return new NotStarted(item); } [CompilationMapping(/*Could not decode attribute arguments.*/)] internal static CollectState<T, U> NewHaveInputEnumerator(IAsyncEnumerator<T> item) { return new HaveInputEnumerator(item); } [CompilationMapping(/*Could not decode attribute arguments.*/)] internal static CollectState<T, U> NewHaveInnerEnumerator(IAsyncEnumerator<T> item1, IAsyncEnumerator<U> item2) { return new HaveInnerEnumerator(item1, item2); } [SpecialName] [CompilerGenerated] [DebuggerNonUserCode] internal object __DebugDisplay() { return ((FSharpFunc<CollectState<CollectState<T, U>, string>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<CollectState<T, U>, string>>((PrintfFormat<FSharpFunc<CollectState<T, U>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<CollectState<FSharpFunc<CollectState<T, U>, string>, Unit>, string>, Unit, string, string, string>("%+0.8A"))).Invoke((CollectState<CollectState<T, U>, string>)(object)this); } [CompilerGenerated] public override string ToString() { return ((FSharpFunc<CollectState<CollectState<T, U>, string>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<CollectState<T, U>, string>>((PrintfFormat<FSharpFunc<CollectState<T, U>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<CollectState<FSharpFunc<CollectState<T, U>, string>, Unit>, string>, Unit, string, string, CollectState<FSharpFunc<CollectState<T, U>, string>, Unit>>("%+A"))).Invoke((CollectState<CollectState<T, U>, string>)(object)this); } [CompilerGenerated] public virtual sealed int GetHashCode(IEqualityComparer comp) { if (this != null) { int num = 0; switch (Tag) { default: return _tag; case 0: { NotStarted notStarted = (NotStarted)this; num = 0; return -1640531527 + (HashCompare.GenericHashWithComparerIntrinsic<IAsyncEnumerable<T>>(comp, notStarted.item) + ((num << 6) + (num >> 2))); } case 1: { HaveInputEnumerator haveInputEnumerator = (HaveInputEnumerator)this; num = 1; return -1640531527 + (HashCompare.GenericHashWithComparerIntrinsic<IAsyncEnumerator<T>>(comp, haveInputEnumerator.item) + ((num << 6) + (num >> 2))); } case 2: { HaveInnerEnumerator haveInnerEnumerator = (HaveInnerEnumerator)this; num = 2; num = -1640531527 + (HashCompare.GenericHashWithComparerIntrinsic<IAsyncEnumerator<U>>(comp, haveInnerEnumerator.item2) + ((num << 6) + (num >> 2))); return -1640531527 + (HashCompare.GenericHashWithComparerIntrinsic<IAsyncEnumerator<T>>(comp, haveInnerEnumerator.item1) + ((num << 6) + (num >> 2))); } } } return 0; } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public virtual sealed bool Equals(object obj, IEqualityComparer comp) { if (this != null) { if (obj is CollectState<T, U> collectState) { int tag = _tag; int tag2 = collectState._tag; if (tag == tag2) { switch (Tag) { default: return true; case 0: { NotStarted notStarted = (NotStarted)this; NotStarted notStarted2 = (NotStarted)collectState; return HashCompare.GenericEqualityWithComparerIntrinsic<IAsyncEnumerable<T>>(comp, notStarted.item, notStarted2.item); } case 1: { HaveInputEnumerator haveInputEnumerator = (HaveInputEnumerator)this; HaveInputEnumerator haveInputEnumerator2 = (HaveInputEnumerator)collectState; return HashCompare.GenericEqualityWithComparerIntrinsic<IAsyncEnumerator<T>>(comp, haveInputEnumerator.item, haveInputEnumerator2.item); } case 2: { HaveInnerEnumerator haveInnerEnumerator = (HaveInnerEnumerator)this; HaveInnerEnumerator haveInnerEnumerator2 = (HaveInnerEnumerator)collectState; if (HashCompare.GenericEqualityWithComparerIntrinsic<IAsyncEnumerator<T>>(comp, haveInnerEnumerator.item1, haveInnerEnumerator2.item1)) { return HashCompare.GenericEqualityWithComparerIntrinsic<IAsyncEnumerator<U>>(comp, haveInnerEnumerator.item2, haveInnerEnumerator2.item2); } return false; } } } return false; } return false; } return obj == null; } [CompilerGenerated] public virtual sealed bool Equals(CollectState<T, U> obj) { if (this != null) { if (obj != null) { int tag = _tag; int tag2 = obj._tag; if (tag == tag2) { switch (Tag) { default: return true; case 0: { NotStarted notStarted = (NotStarted)this; NotStarted notStarted2 = (NotStarted)obj; return HashCompare.GenericEqualityERIntrinsic<IAsyncEnumerable<T>>(notStarted.item, notStarted2.item); } case 1: { HaveInputEnumerator haveInputEnumerator = (HaveInputEnumerator)this; HaveInputEnumerator haveInputEnumerator2 = (HaveInputEnumerator)obj; return HashCompare.GenericEqualityERIntrinsic<IAsyncEnumerator<T>>(haveInputEnumerator.item, haveInputEnumerator2.item); } case 2: { HaveInnerEnumerator haveInnerEnumerator = (HaveInnerEnumerator)this; HaveInnerEnumerator haveInnerEnumerator2 = (HaveInnerEnumerator)obj; if (HashCompare.GenericEqualityERIntrinsic<IAsyncEnumerator<T>>(haveInnerEnumerator.item1, haveInnerEnumerator2.item1)) { return HashCompare.GenericEqualityERIntrinsic<IAsyncEnumerator<U>>(haveInnerEnumerator.item2, haveInnerEnumerator2.item2); } return false; } } } return false; } return false; } return obj == null; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is CollectState<T, U> obj2) { return Equals(obj2); } return false; } } [Serializable] internal sealed class collect@592-3<TResult> : FSharpFunc<AsyncActivation<FSharpOption<TResult>>, AsyncReturn> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpOption<TResult> value; [CompilerGenerated] [DebuggerNonUserCode] internal collect@592-3(FSharpOption<TResult> value) { ((FSharpFunc<AsyncActivation<FSharpOption<AsyncActivation<FSharpOption<TResult>>>>, AsyncReturn>)(object)this)..ctor(); this.value = value; } public unsafe override AsyncReturn Invoke(AsyncActivation<FSharpOption<TResult>> ctxt) { return ((AsyncActivation<FSharpOption<FSharpOption<TResult>>>*)(&ctxt))->OnSuccess((FSharpOption<FSharpOption<TResult>>)(object)value); } } [Serializable] internal sealed class collect@574-4<T, TResult> : FSharpFunc<FSharpOption<T>, FSharpAsync<FSharpOption<TResult>>> { public FSharpFunc<T, IAsyncEnumerable<TResult>> f; public FSharpRef<CollectState<T, TResult>> state; public IAsyncEnumerator<TResult> x; public IAsyncEnumerator<T> e1; [CompilerGenerated] [DebuggerNonUserCode] internal collect@574-4(FSharpFunc<T, IAsyncEnumerable<TResult>> f, FSharpRef<CollectState<T, TResult>> state, IAsyncEnumerator<TResult> x, IAsyncEnumerator<T> e1) { ((FSharpFunc<FSharpOption<FSharpOption<T>>, FSharpAsync<FSharpOption<FSharpAsync<FSharpOption<TResult>>>>>)(object)this)..ctor(); this.f = f; this.state = state; this.x = x; this.e1 = e1; } public override FSharpAsync<FSharpOption<TResult>> Invoke(FSharpOption<T> _arg1) { if (_arg1 == null) { x.Dispose(); } else { T value = _arg1.Value; IAsyncEnumerator<TResult> enumerator = ((FSharpFunc<T, IAsyncEnumerable<IAsyncEnumerable<TResult>>>)(object)f).Invoke(value).GetEnumerator(); ((FSharpRef<CollectState<CollectState<T, TResult>, ?>>)(object)state).contents = (CollectState<CollectState<T, TResult>, ?>)(object)CollectState<T, TResult>.NewHaveInnerEnumerator(e1, enumerator); } return x.MoveNext(); } } [Serializable] internal sealed class collect@573-5<TResult, T> : FSharpFunc<AsyncActivation<FSharpOption<TResult>>, AsyncReturn> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpAsync<FSharpOption<T>> computation; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpFunc<FSharpOption<T>, FSharpAsync<FSharpOption<TResult>>> binder; [CompilerGenerated] [DebuggerNonUserCode] internal collect@573-5(FSharpAsync<FSharpOption<T>> computation, FSharpFunc<FSharpOption<T>, FSharpAsync<FSharpOption<TResult>>> binder) { ((FSharpFunc<AsyncActivation<FSharpOption<AsyncActivation<FSharpOption<TResult>>>>, AsyncReturn>)(object)this)..ctor(); this.computation = computation; this.binder = binder; } public override AsyncReturn Invoke(AsyncActivation<FSharpOption<TResult>> ctxt) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return AsyncPrimitives.Bind<FSharpOption<TResult>, FSharpOption<T>>(ctxt, computation, binder); } } [Serializable] internal sealed class collect@590-7<TResult> : FSharpFunc<AsyncActivation<FSharpOption<TResult>>, AsyncReturn> { [CompilerGenerated] [DebuggerNonUserCode] internal collect@590-7(FSharpOption<TResult> _arg2) { ((FSharpFunc<AsyncActivation<FSharpOption<AsyncActivation<FSharpOption<TResult>>>>, AsyncReturn>)(object)this)..ctor(); this._arg2 = _arg2; } public unsafe override AsyncReturn Invoke(AsyncActivation<FSharpOption<TResult>> ctxt) { return ((AsyncActivation<FSharpOption<FSharpOption<TResult>>>*)(&ctxt))->OnSuccess((FSharpOption<FSharpOption<TResult>>)(object)_arg2); } } [Serializable] internal sealed class collect@584-6<TResult, T> : FSharpFunc<FSharpOption<TResult>, FSharpAsync<FSharpOption<TResult>>> { public FSharpRef<CollectState<T, TResult>> state; public IAsyncEnumerator<TResult> x; public IAsyncEnumerator<TResult> e2; public IAsyncEnumerator<T> e1; [CompilerGenerated] [DebuggerNonUserCode] internal collect@584-6(FSharpRef<CollectState<T, TResult>> state, IAsyncEnumerator<TResult> x, IAsyncEnumerator<TResult> e2, IAsyncEnumerator<T> e1) { ((FSharpFunc<FSharpOption<FSharpOption<TResult>>, FSharpAsync<FSharpOption<FSharpOption<TResult>>>>)(object)this)..ctor(); this.state = state; this.x = x; this.e2 = e2; this.e1 = e1; } public override FSharpAsync<FSharpOption<TResult>> Invoke(FSharpOption<TResult> _arg2) { if (_arg2 != null) { return AsyncPrimitives.MakeAsync<FSharpOption<TResult>>((FSharpFunc<AsyncActivation<FSharpOption<TResult>>, AsyncReturn>)new collect@590-7<TResult>(_arg2)); } ((FSharpRef<CollectState<?, CollectState<T, TResult>>>)(object)state).contents = (CollectState<?, CollectState<T, TResult>>)(object)CollectState<T, TResult>.NewHaveInputEnumerator(e1); IDisposable disposable = e2; try { disposable.Dispose(); Unit val = null; } catch (object obj) { Exception ex = (Exception)obj; Unit val = null; } return x.MoveNext(); } } [Serializable] internal sealed class collect@583-8<TResult> : FSharpFunc<AsyncActivation<FSharpOption<TResult>>, AsyncReturn> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpAsync<FSharpOption<TResult>> computation; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpFunc<FSharpOption<TResult>, FSharpAsync<FSharpOption<TResult>>> binder; [CompilerGenerated] [DebuggerNonUserCode] internal collect@583-8(FSharpAsync<FSharpOption<TResult>> computation, FSharpFunc<FSharpOption<TResult>, FSharpAsync<FSharpOption<TResult>>> binder) { ((FSharpFunc<AsyncActivation<FSharpOption<AsyncActivation<FSharpOption<TResult>>>>, AsyncReturn>)(object)this)..ctor(); this.computation = computation; this.binder = binder; } public override AsyncReturn Invoke(AsyncActivation<FSharpOption<TResult>> ctxt) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return AsyncPrimitives.Bind<FSharpOption<TResult>, FSharpOption<TResult>>(ctxt, computation, binder); } } [Serializable] internal sealed class collect@566-2<TResult, T> : FSharpFunc<Unit, FSharpAsync<FSharpOption<TResult>>> { public FSharpFunc<T, IAsyncEnumerable<TResult>> f; public FSharpRef<CollectState<T, TResult>> state; public IAsyncEnumerator<TResult> x; [CompilerGenerated] [DebuggerNonUserCode] internal collect@566-2(FSharpFunc<T, IAsyncEnumerable<TResult>> f, FSharpRef<CollectState<T, TResult>> state, IAsyncEnumerator<TResult> x) { ((FSharpFunc<Unit, FSharpAsync<FSharpOption<Unit>>>)(object)this)..ctor(); this.f = f; this.state = state; this.x = x; } public override FSharpAsync<FSharpOption<TResult>> Invoke(Unit unitVar) { CollectState<T, TResult> contents = ((FSharpRef<CollectState<?, CollectState<T, TResult>>>)(object)state).contents; switch (contents.Tag) { default: { FSharpOption<TResult> value = null; return AsyncPrimitives.MakeAsync<FSharpOption<TResult>>((FSharpFunc<AsyncActivation<FSharpOption<TResult>>, AsyncReturn>)new collect@592-3<TResult>(value)); } case 0: { CollectState<T, TResult>.NotStarted notStarted = (CollectState<T, TResult>.NotStarted)contents; IAsyncEnumerable<T> item3 = notStarted.item; IAsyncEnumerator<T> item2 = item3.GetEnumerator(); ((FSharpRef<CollectState<?, CollectState<T, TResult>>>)(object)state).contents = (CollectState<?, CollectState<T, TResult>>)(object)CollectState<T, TResult>.NewHaveInputEnumerator(item2); return x.MoveNext(); } case 1: { CollectState<T, TResult>.HaveInputEnumerator haveInputEnumerator = (CollectState<T, TResult>.HaveInputEnumerator)contents; IAsyncEnumerator<T> item2 = haveInputEnumerator.item; FSharpAsync<FSharpOption<T>> computation2 = item2.MoveNext(); FSharpFunc<FSharpOption<T>, FSharpAsync<FSharpOption<TResult>>> binder2 = new collect@574-4<T, TResult>(f, state, x, item2); return AsyncPrimitives.MakeAsync<FSharpOption<TResult>>((FSharpFunc<AsyncActivation<FSharpOption<TResult>>, AsyncReturn>)new collect@573-5<TResult, T>(computation2, binder2)); } case 2: { CollectState<T, TResult>.HaveInnerEnumerator haveInnerEnumerator = (CollectState<T, TResult>.HaveInnerEnumerator)contents; IAsyncEnumerator<TResult> item = haveInnerEnumerator.item2; IAsyncEnumerator<T> item2 = haveInnerEnumerator.item1; FSharpAsync<FSharpOption<TResult>> computation = item.MoveNext(); FSharpFunc<FSharpOption<TResult>, FSharpAsync<FSharpOption<TResult>>> binder = new collect@584-6<TResult, T>(state, x, item, item2); return AsyncPrimitives.MakeAsync<FSharpOption<TResult>>((FSharpFunc<AsyncActivation<FSharpOption<TResult>>, AsyncReturn>)new collect@583-8<TResult>(computation, binder)); } } } } [Serializable] [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal sealed class collect@564-1<TResult, T> : IAsyncEnumerator<TResult> { public FSharpFunc<T, IAsyncEnumerable<TResult>> f; public FSharpRef<CollectState<T, TResult>> state; public collect@564-1(FSharpFunc<T, IAsyncEnumerable<TResult>> f, FSharpRef<CollectState<T, TResult>> state) { this.f = f; this.state = state; base..ctor(); } FSharpAsync<FSharpOption<TResult>> IAsyncEnumerator<TResult>.MoveNext() { return ExtraTopLevelOperators.DefaultAsyncBuilder.Delay<FSharpOption<TResult>>((FSharpFunc<Unit, FSharpAsync<FSharpOption<TResult>>>)new collect@566-2<TResult, T>(f, state, this)); } void IDisposable.Dispose() { CollectState<T, TResult> contents = ((FSharpRef<CollectState<?, CollectState<T, TResult>>>)(object)state).contents; switch (contents.Tag) { case 1: { CollectState<T, TResult>.HaveInputEnumerator haveInputEnumerator = (CollectState<T, TResult>.HaveInputEnumerator)contents; IAsyncEnumerator<T> item2 = haveInputEnumerator.item; ((FSharpRef<CollectState<?, CollectState<T, TResult>>>)(object)state).contents = (CollectState<?, CollectState<T, TResult>>)(object)CollectState<T, TResult>.Finished; IDisposable disposable = item2; try { disposable.Dispose(); Unit val = null; break; } catch (object obj3) { Exception ex = (Exception)obj3; Unit val = null; break; } } case 2: { CollectState<T, TResult>.HaveInnerEnumerator haveInnerEnumerator = (CollectState<T, TResult>.HaveInnerEnumerator)contents; IAsyncEnumerator<TResult> item = haveInnerEnumerator.item2; IAsyncEnumerator<T> item2 = haveInnerEnumerator.item1; ((FSharpRef<CollectState<?, CollectState<T, TResult>>>)(object)state).contents = (CollectState<?, CollectState<T, TResult>>)(object)CollectState<T, TResult>.Finished; IDisposable
BepInEx/core/Mirage.Core/FSharp.Core.dll
Decompiled a month ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.Linq; using System.Linq.Expressions; using System.Net; using System.Numerics; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.ExceptionServices; using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Runtime.Versioning; using System.Security; using System.Text; using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; using <StartupCode$FSharp-Core>; using Microsoft.FSharp.Collections; using Microsoft.FSharp.Control; using Microsoft.FSharp.Core; using Microsoft.FSharp.Core.CompilerServices; using Microsoft.FSharp.Linq; using Microsoft.FSharp.Linq.RuntimeHelpers; using Microsoft.FSharp.Primitives.Basics; using Microsoft.FSharp.Quotations; using Microsoft.FSharp.Reflection; using Microsoft.FSharp.Text.StructuredPrintfImpl; [assembly: FSharpInterfaceDataVersion(2, 0, 0)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Microsoft Corporation")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")] [assembly: AssemblyFileVersion("8.2.24.10803")] [assembly: AssemblyInformationalVersion("8.0.200-beta.24108.3+b64141459e78b327e39bf59bd5f57737ce0a6a44")] [assembly: AssemblyProduct("FSharp.Core")] [assembly: AssemblyTitle("FSharp.Core")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/dotnet/fsharp")] [assembly: NeutralResourcesLanguage("en-US")] [assembly: ComVisible(false)] [assembly: CLSCompliant(true)] [assembly: SecurityTransparent] [assembly: AutoOpen("Microsoft.FSharp")] [assembly: AutoOpen("Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators")] [assembly: AutoOpen("Microsoft.FSharp.Core")] [assembly: AutoOpen("Microsoft.FSharp.Collections")] [assembly: AutoOpen("Microsoft.FSharp.Control")] [assembly: AutoOpen("Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority")] [assembly: AutoOpen("Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority")] [assembly: AutoOpen("Microsoft.FSharp.Control.TaskBuilderExtensions.HighPriority")] [assembly: AutoOpen("Microsoft.FSharp.Linq.QueryRunExtensions.LowPriority")] [assembly: AutoOpen("Microsoft.FSharp.Linq.QueryRunExtensions.HighPriority")] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default)] [assembly: AssemblyVersion("8.0.0.0")] [assembly: TypeForwardedTo(typeof(AggregateException))] [assembly: TypeForwardedTo(typeof(IStructuralComparable))] [assembly: TypeForwardedTo(typeof(IStructuralEquatable))] [assembly: TypeForwardedTo(typeof(IObservable<>))] [assembly: TypeForwardedTo(typeof(IObserver<>))] [assembly: TypeForwardedTo(typeof(Lazy<>))] [assembly: TypeForwardedTo(typeof(BigInteger))] [assembly: TypeForwardedTo(typeof(CancellationToken))] [assembly: TypeForwardedTo(typeof(CancellationTokenRegistration))] [assembly: TypeForwardedTo(typeof(CancellationTokenSource))] [assembly: TypeForwardedTo(typeof(Tuple))] [assembly: TypeForwardedTo(typeof(Tuple<>))] [assembly: TypeForwardedTo(typeof(Tuple<, >))] [assembly: TypeForwardedTo(typeof(Tuple<, , >))] [assembly: TypeForwardedTo(typeof(Tuple<, , , >))] [assembly: TypeForwardedTo(typeof(Tuple<, , , , >))] [assembly: TypeForwardedTo(typeof(Tuple<, , , , , >))] [assembly: TypeForwardedTo(typeof(Tuple<, , , , , , >))] [assembly: TypeForwardedTo(typeof(Tuple<, , , , , , , >))] namespace Microsoft.FSharp.Core { [Serializable] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class Unit : IComparable { internal Unit() { } public override int GetHashCode() { return 0; } public override bool Equals(object obj) { if (obj != null) { if (LanguagePrimitives.IntrinsicFunctions.TypeTestGeneric<Unit>(obj)) { return true; } return false; } return true; } virtual int IComparable.CompareTo(object _obj) { return 0; } } [Serializable] [CompilationMapping(SourceConstructFlags.ObjectType)] public enum SourceConstructFlags { None = 0, SumType = 1, RecordType = 2, ObjectType = 3, Field = 4, Exception = 5, Closure = 6, Module = 7, UnionCase = 8, Value = 9, KindMask = 31, NonPublicRepresentation = 32 } [Serializable] [Flags] [CompilationMapping(SourceConstructFlags.ObjectType)] public enum CompilationRepresentationFlags { None = 0, Static = 1, Instance = 2, ModuleSuffix = 4, UseNullAsTrueValue = 8, Event = 0x10 } [Serializable] [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class SealedAttribute : Attribute { internal bool value; public bool Value => value; public SealedAttribute(bool value) { this.value = value; } public SealedAttribute() : this(value: true) { } } [Serializable] [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class AbstractClassAttribute : Attribute { } [Serializable] [AttributeUsage(AttributeTargets.GenericParameter, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class EqualityConditionalOnAttribute : Attribute { } [Serializable] [AttributeUsage(AttributeTargets.GenericParameter, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class ComparisonConditionalOnAttribute : Attribute { } [Serializable] [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class AllowNullLiteralAttribute : Attribute { internal bool value; public bool Value => value; public AllowNullLiteralAttribute(bool value) { this.value = value; } public AllowNullLiteralAttribute() : this(value: true) { } } [Serializable] [AttributeUsage(AttributeTargets.Field, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class VolatileFieldAttribute : Attribute { } [Serializable] [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class DefaultAugmentationAttribute : Attribute { internal bool value; public bool Value => value; public DefaultAugmentationAttribute(bool value) { this.value = value; } } [Serializable] [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class CLIEventAttribute : Attribute { } [Serializable] [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class CLIMutableAttribute : Attribute { } [Serializable] [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class AutoSerializableAttribute : Attribute { internal bool value; public bool Value => value; public AutoSerializableAttribute(bool value) { this.value = value; } } [Serializable] [AttributeUsage(AttributeTargets.Method | AttributeTargets.Field, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class DefaultValueAttribute : Attribute { internal bool check; public bool Check => check; public DefaultValueAttribute(bool check) { this.check = check; } public DefaultValueAttribute() : this(check: true) { } } [Serializable] [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class EntryPointAttribute : Attribute { } [Serializable] [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class ReferenceEqualityAttribute : Attribute { } [Serializable] [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class StructuralComparisonAttribute : Attribute { } [Serializable] [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class StructuralEqualityAttribute : Attribute { } [Serializable] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class NoEqualityAttribute : Attribute { } [Serializable] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class CustomEqualityAttribute : Attribute { } [Serializable] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class CustomComparisonAttribute : Attribute { } [Serializable] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class NoComparisonAttribute : Attribute { } [Serializable] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Parameter, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class ReflectedDefinitionAttribute : Attribute { internal bool includeValue; public bool IncludeValue => includeValue; public ReflectedDefinitionAttribute(bool includeValue) { this.includeValue = includeValue; } public ReflectedDefinitionAttribute() : this(includeValue: false) { } } [Serializable] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class CompiledNameAttribute : Attribute { internal string compiledName; public string CompiledName => compiledName; public CompiledNameAttribute(string compiledName) { this.compiledName = compiledName; } } [Serializable] [AttributeUsage(AttributeTargets.Struct | AttributeTargets.ReturnValue, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class StructAttribute : Attribute { } [Serializable] [AttributeUsage(AttributeTargets.Class | AttributeTargets.GenericParameter, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class MeasureAttribute : Attribute { } [Serializable] [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class MeasureAnnotatedAbbreviationAttribute : Attribute { } [Serializable] [AttributeUsage(AttributeTargets.Interface, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class InterfaceAttribute : Attribute { } [Serializable] [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class ClassAttribute : Attribute { } [Serializable] [AttributeUsage(AttributeTargets.Field, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class LiteralAttribute : Attribute { } [Serializable] [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class FSharpInterfaceDataVersionAttribute : Attribute { internal int release; internal int minor; internal int major; public int Major => major; public int Minor => minor; public int Release => release; public FSharpInterfaceDataVersionAttribute(int major, int minor, int release) { this.major = major; this.minor = minor; this.release = release; } } [Serializable] [AttributeUsage(AttributeTargets.All, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class CompilationMappingAttribute : Attribute { internal int variantNumber; internal Type[] typeDefinitions; internal SourceConstructFlags sourceConstructFlags; internal int sequenceNumber; internal string resourceName; public SourceConstructFlags SourceConstructFlags => sourceConstructFlags; public int SequenceNumber => sequenceNumber; public int VariantNumber => variantNumber; public Type[] TypeDefinitions => typeDefinitions; public string ResourceName => resourceName; internal CompilationMappingAttribute(SourceConstructFlags sourceConstructFlags, int variantNumber, int sequenceNumber, string resourceName, Type[] typeDefinitions) { this.sourceConstructFlags = sourceConstructFlags; this.variantNumber = variantNumber; this.sequenceNumber = sequenceNumber; this.resourceName = resourceName; this.typeDefinitions = typeDefinitions; } public CompilationMappingAttribute(SourceConstructFlags sourceConstructFlags) : this(sourceConstructFlags, 0, 0) { } public CompilationMappingAttribute(SourceConstructFlags sourceConstructFlags, int sequenceNumber) : this(sourceConstructFlags, 0, sequenceNumber) { } public CompilationMappingAttribute(SourceConstructFlags sourceConstructFlags, int variantNumber, int sequenceNumber) : this(sourceConstructFlags, variantNumber, sequenceNumber, null, null) { } public CompilationMappingAttribute(string resourceName, Type[] typeDefinitions) : this(SourceConstructFlags.None, 0, 0, resourceName, typeDefinitions) { } } [Serializable] [AttributeUsage(AttributeTargets.All, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class CompilationSourceNameAttribute : Attribute { internal string sourceName; public string SourceName => sourceName; public CompilationSourceNameAttribute(string sourceName) { this.sourceName = sourceName; } } [Serializable] [AttributeUsage(AttributeTargets.All, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class CompilationRepresentationAttribute : Attribute { internal CompilationRepresentationFlags flags; public CompilationRepresentationFlags Flags => flags; public CompilationRepresentationAttribute(CompilationRepresentationFlags flags) { this.flags = flags; } } [Serializable] [AttributeUsage(AttributeTargets.All, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class ExperimentalAttribute : Attribute { internal string message; public string Message => message; public ExperimentalAttribute(string message) { this.message = message; } } [Serializable] [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class InlineIfLambdaAttribute : Attribute { } [Serializable] [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class CompilationArgumentCountsAttribute : Attribute { internal int[] counts; public IEnumerable<int> Counts => (IEnumerable<int>)counts.Clone(); public CompilationArgumentCountsAttribute(int[] counts) { this.counts = counts; } } [Serializable] [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class CustomOperationAttribute : Attribute { internal string name; internal bool isBinary; internal bool allowInto; internal bool isJoin; internal bool isGroupJoin; internal bool maintainsVarSpace; internal bool maintainsVarSpaceWithBind; internal string joinOnWord; public string Name => name; public bool AllowIntoPattern { get { return allowInto; } set { allowInto = value; } } public bool IsLikeZip { get { return isBinary; } set { isBinary = value; } } public bool IsLikeJoin { get { return isJoin; } set { isJoin = value; } } public bool IsLikeGroupJoin { get { return isGroupJoin; } set { isGroupJoin = value; } } public string JoinConditionWord { get { return joinOnWord; } set { joinOnWord = value; } } public bool MaintainsVariableSpace { get { return maintainsVarSpace; } set { maintainsVarSpace = value; } } public bool MaintainsVariableSpaceUsingBind { get { return maintainsVarSpaceWithBind; } set { maintainsVarSpaceWithBind = value; } } public CustomOperationAttribute(string name) { this.name = name; isBinary = false; allowInto = false; isJoin = false; isGroupJoin = false; maintainsVarSpace = false; maintainsVarSpaceWithBind = false; joinOnWord = ""; } public CustomOperationAttribute() : this("") { } } [Serializable] [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class ProjectionParameterAttribute : Attribute { } [Serializable] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class StructuredFormatDisplayAttribute : Attribute { internal string value; public string Value => value; public StructuredFormatDisplayAttribute(string value) { this.value = value; } } [Serializable] [AttributeUsage(AttributeTargets.All, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class CompilerMessageAttribute : Attribute { internal int messageNumber; internal string message; internal bool isError; internal bool isHidden; public string Message => message; public int MessageNumber => messageNumber; public bool IsError { get { return isError; } set { isError = value; } } public bool IsHidden { get { return isHidden; } set { isHidden = value; } } public CompilerMessageAttribute(string message, int messageNumber) { this.message = message; this.messageNumber = messageNumber; isError = false; isHidden = false; } } [Serializable] [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class UnverifiableAttribute : Attribute { } [Serializable] [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class NoDynamicInvocationAttribute : Attribute { internal bool isLegacy; internal bool IsLegacy => isLegacy; internal NoDynamicInvocationAttribute(bool isLegacy) { this.isLegacy = isLegacy; } public NoDynamicInvocationAttribute() : this(isLegacy: false) { } } [Serializable] [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class OptionalArgumentAttribute : Attribute { } [Serializable] [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class GeneralizableValueAttribute : Attribute { } [Serializable] [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class RequiresExplicitTypeArgumentsAttribute : Attribute { } [Serializable] [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class RequireQualifiedAccessAttribute : Attribute { } [Serializable] [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class, AllowMultiple = true)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class AutoOpenAttribute : Attribute { internal string path; public string Path => path; public AutoOpenAttribute(string path) { this.path = path; } public AutoOpenAttribute() : this("") { } } [Serializable] [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] internal sealed class ValueAsStaticPropertyAttribute : Attribute { } [Serializable] [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class NoCompilerInliningAttribute : Attribute { } [Serializable] [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] [Sealed] [CompilationMapping(SourceConstructFlags.ObjectType)] public sealed class TailCallAttribute : Attribute { } } namespace System.Diagnostics.CodeAnalysis { [Serializable] [Flags] [RequireQualifiedAccess] [CompilationMapping(SourceConstructFlags.ObjectType)] internal enum DynamicallyAccessedMemberTypes { None = 0, PublicParameterlessConstructor = 1, PublicConstructors = 3, NonPublicConstructors = 4, PublicMethods = 8, NonPublicMethods = 0x10, PublicFields = 0x20, NonPublicFields = 0x40, PublicNestedTypes = 0x80, NonPublicNestedTypes = 0x100, PublicProperties = 0x200, NonPublicProperties = 0x400, PublicEvents = 0x800, NonPublicEvents = 0x1000, Interfaces = 0x2000, All = -1 } [Serializable] [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, Inherited = false)] [CompilationMapping(SourceConstructFlags.ObjectType)] internal class DynamicallyAccessedMembersAttribute : Attribute { internal DynamicallyAccessedMemberTypes MemberTypes@; internal DynamicallyAccessedMemberTypes MemberTypes { [CompilerGenerated] [DebuggerNonUserCode] get { return MemberTypes@; } [CompilerGenerated] [DebuggerNonUserCode] set { MemberTypes@ = value; } } public DynamicallyAccessedMembersAttribute(DynamicallyAccessedMemberTypes memberTypes) { MemberTypes@ = memberTypes; } internal void DynamicallyAccessedMembersAttribute(DynamicallyAccessedMemberTypes memberTypes) { MemberTypes@ = memberTypes; } } } namespace Microsoft.FSharp.Core { [Serializable] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [StructuralEquality] [StructuralComparison] [CompiledName("FSharpChoice`2")] [CompilationMapping(SourceConstructFlags.SumType)] public abstract class FSharpChoice<T1, T2> : IEquatable<FSharpChoice<T1, T2>>, IStructuralEquatable, IComparable<FSharpChoice<T1, T2>>, IComparable, IStructuralComparable { public static class Tags { public const int Choice1Of2 = 0; public const int Choice2Of2 = 1; } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(FSharpChoice<, >.Choice1Of2@DebugTypeProxy))] public class Choice1Of2 : FSharpChoice<T1, T2> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T1 item; [CompilationMapping(SourceConstructFlags.Field, 0, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T1 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, >))] [CompilerGenerated] [DebuggerNonUserCode] internal Choice1Of2(T1 item) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(FSharpChoice<, >.Choice2Of2@DebugTypeProxy))] public class Choice2Of2 : FSharpChoice<T1, T2> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T2 item; [CompilationMapping(SourceConstructFlags.Field, 1, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T2 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, >))] [CompilerGenerated] [DebuggerNonUserCode] internal Choice2Of2(T2 item) { this.item = item; } } [SpecialName] internal class Choice1Of2@DebugTypeProxy { [CompilationMapping(SourceConstructFlags.Field, 0, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T1 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, >))] [CompilerGenerated] [DebuggerNonUserCode] public Choice1Of2@DebugTypeProxy(Choice1Of2 obj) { _obj = obj; } } [SpecialName] internal class Choice2Of2@DebugTypeProxy { [CompilationMapping(SourceConstructFlags.Field, 1, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T2 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, >))] [CompilerGenerated] [DebuggerNonUserCode] public Choice2Of2@DebugTypeProxy(Choice2Of2 obj) { _obj = obj; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public int Tag { [CompilerGenerated] [DebuggerNonUserCode] get { return (this is Choice2Of2) ? 1 : 0; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsChoice1Of2 { [CompilerGenerated] [DebuggerNonUserCode] get { return this is Choice1Of2; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsChoice2Of2 { [CompilerGenerated] [DebuggerNonUserCode] get { return this is Choice2Of2; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicNestedTypes | DynamicallyAccessedMemberTypes.NonPublicNestedTypes | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, >))] [CompilerGenerated] [DebuggerNonUserCode] internal FSharpChoice() { } [CompilationMapping(SourceConstructFlags.UnionCase, 0)] public static FSharpChoice<T1, T2> NewChoice1Of2(T1 item) { return new Choice1Of2(item); } [CompilationMapping(SourceConstructFlags.UnionCase, 1)] public static FSharpChoice<T1, T2> NewChoice2Of2(T2 item) { return new Choice2Of2(item); } [CompilerGenerated] public virtual sealed int CompareTo(FSharpChoice<T1, T2> obj) { if (this != null) { if (obj != null) { int num = ((this is Choice2Of2) ? 1 : 0); int num2 = ((obj is Choice2Of2) ? 1 : 0); if (num == num2) { IComparer genericComparer; if (this is Choice1Of2) { Choice1Of2 choice1Of = (Choice1Of2)this; Choice1Of2 choice1Of2 = (Choice1Of2)obj; genericComparer = LanguagePrimitives.GenericComparer; T1 item = choice1Of.item; T1 item2 = choice1Of2.item; return LanguagePrimitives.HashCompare.GenericComparisonWithComparerIntrinsic(genericComparer, item, item2); } Choice2Of2 choice2Of = (Choice2Of2)this; Choice2Of2 choice2Of2 = (Choice2Of2)obj; genericComparer = LanguagePrimitives.GenericComparer; T2 item3 = choice2Of.item; T2 item4 = choice2Of2.item; return LanguagePrimitives.HashCompare.GenericComparisonWithComparerIntrinsic(genericComparer, item3, item4); } return num - num2; } return 1; } if (obj != null) { return -1; } return 0; } [CompilerGenerated] public virtual sealed int CompareTo(object obj) { return CompareTo((FSharpChoice<T1, T2>)obj); } [CompilerGenerated] public virtual sealed int CompareTo(object obj, IComparer comp) { FSharpChoice<T1, T2> fSharpChoice = (FSharpChoice<T1, T2>)obj; if (this != null) { if ((FSharpChoice<T1, T2>)obj != null) { int num = ((this is Choice2Of2) ? 1 : 0); FSharpChoice<T1, T2> fSharpChoice2 = fSharpChoice; int num2 = ((fSharpChoice2 is Choice2Of2) ? 1 : 0); if (num == num2) { if (this is Choice1Of2) { Choice1Of2 choice1Of = (Choice1Of2)this; Choice1Of2 choice1Of2 = (Choice1Of2)fSharpChoice; T1 item = choice1Of.item; T1 item2 = choice1Of2.item; return LanguagePrimitives.HashCompare.GenericComparisonWithComparerIntrinsic(comp, item, item2); } Choice2Of2 choice2Of = (Choice2Of2)this; Choice2Of2 choice2Of2 = (Choice2Of2)fSharpChoice; T2 item3 = choice2Of.item; T2 item4 = choice2Of2.item; return LanguagePrimitives.HashCompare.GenericComparisonWithComparerIntrinsic(comp, item3, item4); } return num - num2; } return 1; } if ((FSharpChoice<T1, T2>)obj != null) { return -1; } return 0; } [CompilerGenerated] public virtual sealed int GetHashCode(IEqualityComparer comp) { if (this != null) { int num = 0; if (this is Choice1Of2) { Choice1Of2 choice1Of = (Choice1Of2)this; num = 0; T1 item = choice1Of.item; return -1640531527 + (LanguagePrimitives.HashCompare.GenericHashParamObj(comp, item) + ((num << 6) + (num >> 2))); } Choice2Of2 choice2Of = (Choice2Of2)this; num = 1; T2 item2 = choice2Of.item; return -1640531527 + (LanguagePrimitives.HashCompare.GenericHashParamObj(comp, item2) + ((num << 6) + (num >> 2))); } return 0; } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public virtual sealed bool Equals(object obj, IEqualityComparer comp) { if (this != null) { if (obj is FSharpChoice<T1, T2> fSharpChoice) { int num = ((this is Choice2Of2) ? 1 : 0); FSharpChoice<T1, T2> fSharpChoice2 = fSharpChoice; int num2 = ((fSharpChoice2 is Choice2Of2) ? 1 : 0); if (num == num2) { if (this is Choice1Of2) { Choice1Of2 choice1Of = (Choice1Of2)this; Choice1Of2 choice1Of2 = (Choice1Of2)fSharpChoice; T1 item = choice1Of.item; T1 item2 = choice1Of2.item; return LanguagePrimitives.HashCompare.GenericEqualityWithComparerIntrinsic(comp, item, item2); } Choice2Of2 choice2Of = (Choice2Of2)this; Choice2Of2 choice2Of2 = (Choice2Of2)fSharpChoice; T2 item3 = choice2Of.item; T2 item4 = choice2Of2.item; return LanguagePrimitives.HashCompare.GenericEqualityWithComparerIntrinsic(comp, item3, item4); } return false; } return false; } return obj == null; } [CompilerGenerated] public virtual sealed bool Equals(FSharpChoice<T1, T2> obj) { if (this != null) { if (obj != null) { int num = ((this is Choice2Of2) ? 1 : 0); int num2 = ((obj is Choice2Of2) ? 1 : 0); if (num == num2) { if (this is Choice1Of2) { Choice1Of2 choice1Of = (Choice1Of2)this; Choice1Of2 choice1Of2 = (Choice1Of2)obj; T1 item = choice1Of.item; T1 item2 = choice1Of2.item; return LanguagePrimitives.HashCompare.GenericEqualityERIntrinsic(item, item2); } Choice2Of2 choice2Of = (Choice2Of2)this; Choice2Of2 choice2Of2 = (Choice2Of2)obj; T2 item3 = choice2Of.item; T2 item4 = choice2Of2.item; return LanguagePrimitives.HashCompare.GenericEqualityERIntrinsic(item3, item4); } return false; } return false; } return obj == null; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is FSharpChoice<T1, T2> obj2) { return Equals(obj2); } return false; } } [Serializable] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [StructuralEquality] [StructuralComparison] [CompiledName("FSharpChoice`3")] [CompilationMapping(SourceConstructFlags.SumType)] public abstract class FSharpChoice<T1, T2, T3> : IEquatable<FSharpChoice<T1, T2, T3>>, IStructuralEquatable, IComparable<FSharpChoice<T1, T2, T3>>, IComparable, IStructuralComparable { public static class Tags { public const int Choice1Of3 = 0; public const int Choice2Of3 = 1; public const int Choice3Of3 = 2; } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(FSharpChoice<, , >.Choice1Of3@DebugTypeProxy))] public class Choice1Of3 : FSharpChoice<T1, T2, T3> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T1 item; [CompilationMapping(SourceConstructFlags.Field, 0, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T1 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , >))] [CompilerGenerated] [DebuggerNonUserCode] internal Choice1Of3(T1 item) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(FSharpChoice<, , >.Choice2Of3@DebugTypeProxy))] public class Choice2Of3 : FSharpChoice<T1, T2, T3> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T2 item; [CompilationMapping(SourceConstructFlags.Field, 1, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T2 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , >))] [CompilerGenerated] [DebuggerNonUserCode] internal Choice2Of3(T2 item) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(FSharpChoice<, , >.Choice3Of3@DebugTypeProxy))] public class Choice3Of3 : FSharpChoice<T1, T2, T3> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T3 item; [CompilationMapping(SourceConstructFlags.Field, 2, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T3 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , >))] [CompilerGenerated] [DebuggerNonUserCode] internal Choice3Of3(T3 item) { this.item = item; } } [SpecialName] internal class Choice1Of3@DebugTypeProxy { [CompilationMapping(SourceConstructFlags.Field, 0, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T1 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , >))] [CompilerGenerated] [DebuggerNonUserCode] public Choice1Of3@DebugTypeProxy(Choice1Of3 obj) { _obj = obj; } } [SpecialName] internal class Choice2Of3@DebugTypeProxy { [CompilationMapping(SourceConstructFlags.Field, 1, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T2 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , >))] [CompilerGenerated] [DebuggerNonUserCode] public Choice2Of3@DebugTypeProxy(Choice2Of3 obj) { _obj = obj; } } [SpecialName] internal class Choice3Of3@DebugTypeProxy { [CompilationMapping(SourceConstructFlags.Field, 2, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T3 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , >))] [CompilerGenerated] [DebuggerNonUserCode] public Choice3Of3@DebugTypeProxy(Choice3Of3 obj) { _obj = obj; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public int Tag { [CompilerGenerated] [DebuggerNonUserCode] get { return (this is Choice3Of3) ? 2 : ((this is Choice2Of3) ? 1 : 0); } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsChoice1Of3 { [CompilerGenerated] [DebuggerNonUserCode] get { return this is Choice1Of3; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsChoice2Of3 { [CompilerGenerated] [DebuggerNonUserCode] get { return this is Choice2Of3; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsChoice3Of3 { [CompilerGenerated] [DebuggerNonUserCode] get { return this is Choice3Of3; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicNestedTypes | DynamicallyAccessedMemberTypes.NonPublicNestedTypes | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , >))] [CompilerGenerated] [DebuggerNonUserCode] internal FSharpChoice() { } [CompilationMapping(SourceConstructFlags.UnionCase, 0)] public static FSharpChoice<T1, T2, T3> NewChoice1Of3(T1 item) { return new Choice1Of3(item); } [CompilationMapping(SourceConstructFlags.UnionCase, 1)] public static FSharpChoice<T1, T2, T3> NewChoice2Of3(T2 item) { return new Choice2Of3(item); } [CompilationMapping(SourceConstructFlags.UnionCase, 2)] public static FSharpChoice<T1, T2, T3> NewChoice3Of3(T3 item) { return new Choice3Of3(item); } [CompilerGenerated] public virtual sealed int CompareTo(FSharpChoice<T1, T2, T3> obj) { if (this != null) { if (obj != null) { int num = ((this is Choice3Of3) ? 2 : ((this is Choice2Of3) ? 1 : 0)); int num2 = ((obj is Choice3Of3) ? 2 : ((obj is Choice2Of3) ? 1 : 0)); if (num == num2) { IComparer genericComparer; if (!(this is Choice1Of3)) { if (this is Choice2Of3) { Choice2Of3 choice2Of = (Choice2Of3)this; Choice2Of3 choice2Of2 = (Choice2Of3)obj; genericComparer = LanguagePrimitives.GenericComparer; T2 item = choice2Of.item; T2 item2 = choice2Of2.item; return LanguagePrimitives.HashCompare.GenericComparisonWithComparerIntrinsic(genericComparer, item, item2); } if (this is Choice3Of3) { Choice3Of3 choice3Of = (Choice3Of3)this; Choice3Of3 choice3Of2 = (Choice3Of3)obj; genericComparer = LanguagePrimitives.GenericComparer; T3 item3 = choice3Of.item; T3 item4 = choice3Of2.item; return LanguagePrimitives.HashCompare.GenericComparisonWithComparerIntrinsic(genericComparer, item3, item4); } } Choice1Of3 choice1Of = (Choice1Of3)this; Choice1Of3 choice1Of2 = (Choice1Of3)obj; genericComparer = LanguagePrimitives.GenericComparer; T1 item5 = choice1Of.item; T1 item6 = choice1Of2.item; return LanguagePrimitives.HashCompare.GenericComparisonWithComparerIntrinsic(genericComparer, item5, item6); } return num - num2; } return 1; } if (obj != null) { return -1; } return 0; } [CompilerGenerated] public virtual sealed int CompareTo(object obj) { return CompareTo((FSharpChoice<T1, T2, T3>)obj); } [CompilerGenerated] public virtual sealed int CompareTo(object obj, IComparer comp) { FSharpChoice<T1, T2, T3> fSharpChoice = (FSharpChoice<T1, T2, T3>)obj; if (this != null) { if ((FSharpChoice<T1, T2, T3>)obj != null) { int num = ((this is Choice3Of3) ? 2 : ((this is Choice2Of3) ? 1 : 0)); FSharpChoice<T1, T2, T3> fSharpChoice2 = fSharpChoice; int num2 = ((fSharpChoice2 is Choice3Of3) ? 2 : ((fSharpChoice2 is Choice2Of3) ? 1 : 0)); if (num == num2) { if (!(this is Choice1Of3)) { if (this is Choice2Of3) { Choice2Of3 choice2Of = (Choice2Of3)this; Choice2Of3 choice2Of2 = (Choice2Of3)fSharpChoice; T2 item = choice2Of.item; T2 item2 = choice2Of2.item; return LanguagePrimitives.HashCompare.GenericComparisonWithComparerIntrinsic(comp, item, item2); } if (this is Choice3Of3) { Choice3Of3 choice3Of = (Choice3Of3)this; Choice3Of3 choice3Of2 = (Choice3Of3)fSharpChoice; T3 item3 = choice3Of.item; T3 item4 = choice3Of2.item; return LanguagePrimitives.HashCompare.GenericComparisonWithComparerIntrinsic(comp, item3, item4); } } Choice1Of3 choice1Of = (Choice1Of3)this; Choice1Of3 choice1Of2 = (Choice1Of3)fSharpChoice; T1 item5 = choice1Of.item; T1 item6 = choice1Of2.item; return LanguagePrimitives.HashCompare.GenericComparisonWithComparerIntrinsic(comp, item5, item6); } return num - num2; } return 1; } if ((FSharpChoice<T1, T2, T3>)obj != null) { return -1; } return 0; } [CompilerGenerated] public virtual sealed int GetHashCode(IEqualityComparer comp) { if (this != null) { int num = 0; if (!(this is Choice1Of3)) { if (this is Choice2Of3) { Choice2Of3 choice2Of = (Choice2Of3)this; num = 1; T2 item = choice2Of.item; return -1640531527 + (LanguagePrimitives.HashCompare.GenericHashParamObj(comp, item) + ((num << 6) + (num >> 2))); } if (this is Choice3Of3) { Choice3Of3 choice3Of = (Choice3Of3)this; num = 2; T3 item2 = choice3Of.item; return -1640531527 + (LanguagePrimitives.HashCompare.GenericHashParamObj(comp, item2) + ((num << 6) + (num >> 2))); } } Choice1Of3 choice1Of = (Choice1Of3)this; num = 0; T1 item3 = choice1Of.item; return -1640531527 + (LanguagePrimitives.HashCompare.GenericHashParamObj(comp, item3) + ((num << 6) + (num >> 2))); } return 0; } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public virtual sealed bool Equals(object obj, IEqualityComparer comp) { if (this != null) { if (obj is FSharpChoice<T1, T2, T3> fSharpChoice) { int num = ((this is Choice3Of3) ? 2 : ((this is Choice2Of3) ? 1 : 0)); FSharpChoice<T1, T2, T3> fSharpChoice2 = fSharpChoice; int num2 = ((fSharpChoice2 is Choice3Of3) ? 2 : ((fSharpChoice2 is Choice2Of3) ? 1 : 0)); if (num == num2) { if (!(this is Choice1Of3)) { if (this is Choice2Of3) { Choice2Of3 choice2Of = (Choice2Of3)this; Choice2Of3 choice2Of2 = (Choice2Of3)fSharpChoice; T2 item = choice2Of.item; T2 item2 = choice2Of2.item; return LanguagePrimitives.HashCompare.GenericEqualityWithComparerIntrinsic(comp, item, item2); } if (this is Choice3Of3) { Choice3Of3 choice3Of = (Choice3Of3)this; Choice3Of3 choice3Of2 = (Choice3Of3)fSharpChoice; T3 item3 = choice3Of.item; T3 item4 = choice3Of2.item; return LanguagePrimitives.HashCompare.GenericEqualityWithComparerIntrinsic(comp, item3, item4); } } Choice1Of3 choice1Of = (Choice1Of3)this; Choice1Of3 choice1Of2 = (Choice1Of3)fSharpChoice; T1 item5 = choice1Of.item; T1 item6 = choice1Of2.item; return LanguagePrimitives.HashCompare.GenericEqualityWithComparerIntrinsic(comp, item5, item6); } return false; } return false; } return obj == null; } [CompilerGenerated] public virtual sealed bool Equals(FSharpChoice<T1, T2, T3> obj) { if (this != null) { if (obj != null) { int num = ((this is Choice3Of3) ? 2 : ((this is Choice2Of3) ? 1 : 0)); int num2 = ((obj is Choice3Of3) ? 2 : ((obj is Choice2Of3) ? 1 : 0)); if (num == num2) { if (!(this is Choice1Of3)) { if (this is Choice2Of3) { Choice2Of3 choice2Of = (Choice2Of3)this; Choice2Of3 choice2Of2 = (Choice2Of3)obj; T2 item = choice2Of.item; T2 item2 = choice2Of2.item; return LanguagePrimitives.HashCompare.GenericEqualityERIntrinsic(item, item2); } if (this is Choice3Of3) { Choice3Of3 choice3Of = (Choice3Of3)this; Choice3Of3 choice3Of2 = (Choice3Of3)obj; T3 item3 = choice3Of.item; T3 item4 = choice3Of2.item; return LanguagePrimitives.HashCompare.GenericEqualityERIntrinsic(item3, item4); } } Choice1Of3 choice1Of = (Choice1Of3)this; Choice1Of3 choice1Of2 = (Choice1Of3)obj; T1 item5 = choice1Of.item; T1 item6 = choice1Of2.item; return LanguagePrimitives.HashCompare.GenericEqualityERIntrinsic(item5, item6); } return false; } return false; } return obj == null; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is FSharpChoice<T1, T2, T3> obj2) { return Equals(obj2); } return false; } } [Serializable] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [StructuralEquality] [StructuralComparison] [CompiledName("FSharpChoice`4")] [CompilationMapping(SourceConstructFlags.SumType)] public abstract class FSharpChoice<T1, T2, T3, T4> : IEquatable<FSharpChoice<T1, T2, T3, T4>>, IStructuralEquatable, IComparable<FSharpChoice<T1, T2, T3, T4>>, IComparable, IStructuralComparable { public static class Tags { public const int Choice1Of4 = 0; public const int Choice2Of4 = 1; public const int Choice3Of4 = 2; public const int Choice4Of4 = 3; } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(FSharpChoice<, , , >.Choice1Of4@DebugTypeProxy))] public class Choice1Of4 : FSharpChoice<T1, T2, T3, T4> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T1 item; [CompilationMapping(SourceConstructFlags.Field, 0, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T1 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , >))] [CompilerGenerated] [DebuggerNonUserCode] internal Choice1Of4(T1 item) : base(0) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(FSharpChoice<, , , >.Choice2Of4@DebugTypeProxy))] public class Choice2Of4 : FSharpChoice<T1, T2, T3, T4> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T2 item; [CompilationMapping(SourceConstructFlags.Field, 1, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T2 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , >))] [CompilerGenerated] [DebuggerNonUserCode] internal Choice2Of4(T2 item) : base(1) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(FSharpChoice<, , , >.Choice3Of4@DebugTypeProxy))] public class Choice3Of4 : FSharpChoice<T1, T2, T3, T4> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T3 item; [CompilationMapping(SourceConstructFlags.Field, 2, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T3 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , >))] [CompilerGenerated] [DebuggerNonUserCode] internal Choice3Of4(T3 item) : base(2) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(FSharpChoice<, , , >.Choice4Of4@DebugTypeProxy))] public class Choice4Of4 : FSharpChoice<T1, T2, T3, T4> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T4 item; [CompilationMapping(SourceConstructFlags.Field, 3, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T4 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , >))] [CompilerGenerated] [DebuggerNonUserCode] internal Choice4Of4(T4 item) : base(3) { this.item = item; } } [SpecialName] internal class Choice1Of4@DebugTypeProxy { [CompilationMapping(SourceConstructFlags.Field, 0, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T1 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , >))] [CompilerGenerated] [DebuggerNonUserCode] public Choice1Of4@DebugTypeProxy(Choice1Of4 obj) { _obj = obj; } } [SpecialName] internal class Choice2Of4@DebugTypeProxy { [CompilationMapping(SourceConstructFlags.Field, 1, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T2 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , >))] [CompilerGenerated] [DebuggerNonUserCode] public Choice2Of4@DebugTypeProxy(Choice2Of4 obj) { _obj = obj; } } [SpecialName] internal class Choice3Of4@DebugTypeProxy { [CompilationMapping(SourceConstructFlags.Field, 2, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T3 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , >))] [CompilerGenerated] [DebuggerNonUserCode] public Choice3Of4@DebugTypeProxy(Choice3Of4 obj) { _obj = obj; } } [SpecialName] internal class Choice4Of4@DebugTypeProxy { [CompilationMapping(SourceConstructFlags.Field, 3, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T4 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , >))] [CompilerGenerated] [DebuggerNonUserCode] public Choice4Of4@DebugTypeProxy(Choice4Of4 obj) { _obj = obj; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public int Tag { [DebuggerNonUserCode] get; } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsChoice1Of4 { [CompilerGenerated] [DebuggerNonUserCode] get { return Tag == 0; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsChoice2Of4 { [CompilerGenerated] [DebuggerNonUserCode] get { return Tag == 1; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsChoice3Of4 { [CompilerGenerated] [DebuggerNonUserCode] get { return Tag == 2; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsChoice4Of4 { [CompilerGenerated] [DebuggerNonUserCode] get { return Tag == 3; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicNestedTypes | DynamicallyAccessedMemberTypes.NonPublicNestedTypes | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , >))] [CompilerGenerated] [DebuggerNonUserCode] internal FSharpChoice(int _tag) { this._tag = _tag; } [CompilationMapping(SourceConstructFlags.UnionCase, 0)] public static FSharpChoice<T1, T2, T3, T4> NewChoice1Of4(T1 item) { return new Choice1Of4(item); } [CompilationMapping(SourceConstructFlags.UnionCase, 1)] public static FSharpChoice<T1, T2, T3, T4> NewChoice2Of4(T2 item) { return new Choice2Of4(item); } [CompilationMapping(SourceConstructFlags.UnionCase, 2)] public static FSharpChoice<T1, T2, T3, T4> NewChoice3Of4(T3 item) { return new Choice3Of4(item); } [CompilationMapping(SourceConstructFlags.UnionCase, 3)] public static FSharpChoice<T1, T2, T3, T4> NewChoice4Of4(T4 item) { return new Choice4Of4(item); } [CompilerGenerated] public virtual sealed int CompareTo(FSharpChoice<T1, T2, T3, T4> obj) { if (this != null) { if (obj != null) { int tag = _tag; int tag2 = obj._tag; if (tag == tag2) { switch (Tag) { default: { Choice1Of4 choice1Of = (Choice1Of4)this; Choice1Of4 choice1Of2 = (Choice1Of4)obj; IComparer genericComparer = LanguagePrimitives.GenericComparer; T1 item7 = choice1Of.item; T1 item8 = choice1Of2.item; return LanguagePrimitives.HashCompare.GenericComparisonWithComparerIntrinsic(genericComparer, item7, item8); } case 1: { Choice2Of4 choice2Of = (Choice2Of4)this; Choice2Of4 choice2Of2 = (Choice2Of4)obj; IComparer genericComparer = LanguagePrimitives.GenericComparer; T2 item5 = choice2Of.item; T2 item6 = choice2Of2.item; return LanguagePrimitives.HashCompare.GenericComparisonWithComparerIntrinsic(genericComparer, item5, item6); } case 2: { Choice3Of4 choice3Of = (Choice3Of4)this; Choice3Of4 choice3Of2 = (Choice3Of4)obj; IComparer genericComparer = LanguagePrimitives.GenericComparer; T3 item3 = choice3Of.item; T3 item4 = choice3Of2.item; return LanguagePrimitives.HashCompare.GenericComparisonWithComparerIntrinsic(genericComparer, item3, item4); } case 3: { Choice4Of4 choice4Of = (Choice4Of4)this; Choice4Of4 choice4Of2 = (Choice4Of4)obj; IComparer genericComparer = LanguagePrimitives.GenericComparer; T4 item = choice4Of.item; T4 item2 = choice4Of2.item; return LanguagePrimitives.HashCompare.GenericComparisonWithComparerIntrinsic(genericComparer, item, item2); } } } return tag - tag2; } return 1; } if (obj != null) { return -1; } return 0; } [CompilerGenerated] public virtual sealed int CompareTo(object obj) { return CompareTo((FSharpChoice<T1, T2, T3, T4>)obj); } [CompilerGenerated] public virtual sealed int CompareTo(object obj, IComparer comp) { FSharpChoice<T1, T2, T3, T4> fSharpChoice = (FSharpChoice<T1, T2, T3, T4>)obj; if (this != null) { if ((FSharpChoice<T1, T2, T3, T4>)obj != null) { int tag = _tag; int tag2 = fSharpChoice._tag; if (tag == tag2) { switch (Tag) { default: { Choice1Of4 choice1Of = (Choice1Of4)this; Choice1Of4 choice1Of2 = (Choice1Of4)fSharpChoice; T1 item7 = choice1Of.item; T1 item8 = choice1Of2.item; return LanguagePrimitives.HashCompare.GenericComparisonWithComparerIntrinsic(comp, item7, item8); } case 1: { Choice2Of4 choice2Of = (Choice2Of4)this; Choice2Of4 choice2Of2 = (Choice2Of4)fSharpChoice; T2 item5 = choice2Of.item; T2 item6 = choice2Of2.item; return LanguagePrimitives.HashCompare.GenericComparisonWithComparerIntrinsic(comp, item5, item6); } case 2: { Choice3Of4 choice3Of = (Choice3Of4)this; Choice3Of4 choice3Of2 = (Choice3Of4)fSharpChoice; T3 item3 = choice3Of.item; T3 item4 = choice3Of2.item; return LanguagePrimitives.HashCompare.GenericComparisonWithComparerIntrinsic(comp, item3, item4); } case 3: { Choice4Of4 choice4Of = (Choice4Of4)this; Choice4Of4 choice4Of2 = (Choice4Of4)fSharpChoice; T4 item = choice4Of.item; T4 item2 = choice4Of2.item; return LanguagePrimitives.HashCompare.GenericComparisonWithComparerIntrinsic(comp, item, item2); } } } return tag - tag2; } return 1; } if ((FSharpChoice<T1, T2, T3, T4>)obj != null) { return -1; } return 0; } [CompilerGenerated] public virtual sealed int GetHashCode(IEqualityComparer comp) { if (this != null) { int num = 0; switch (Tag) { default: { Choice1Of4 choice1Of = (Choice1Of4)this; num = 0; T1 item4 = choice1Of.item; return -1640531527 + (LanguagePrimitives.HashCompare.GenericHashParamObj(comp, item4) + ((num << 6) + (num >> 2))); } case 1: { Choice2Of4 choice2Of = (Choice2Of4)this; num = 1; T2 item3 = choice2Of.item; return -1640531527 + (LanguagePrimitives.HashCompare.GenericHashParamObj(comp, item3) + ((num << 6) + (num >> 2))); } case 2: { Choice3Of4 choice3Of = (Choice3Of4)this; num = 2; T3 item2 = choice3Of.item; return -1640531527 + (LanguagePrimitives.HashCompare.GenericHashParamObj(comp, item2) + ((num << 6) + (num >> 2))); } case 3: { Choice4Of4 choice4Of = (Choice4Of4)this; num = 3; T4 item = choice4Of.item; return -1640531527 + (LanguagePrimitives.HashCompare.GenericHashParamObj(comp, item) + ((num << 6) + (num >> 2))); } } } return 0; } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public virtual sealed bool Equals(object obj, IEqualityComparer comp) { if (this != null) { if (obj is FSharpChoice<T1, T2, T3, T4> fSharpChoice) { int tag = _tag; int tag2 = fSharpChoice._tag; if (tag == tag2) { switch (Tag) { default: { Choice1Of4 choice1Of = (Choice1Of4)this; Choice1Of4 choice1Of2 = (Choice1Of4)fSharpChoice; T1 item7 = choice1Of.item; T1 item8 = choice1Of2.item; return LanguagePrimitives.HashCompare.GenericEqualityWithComparerIntrinsic(comp, item7, item8); } case 1: { Choice2Of4 choice2Of = (Choice2Of4)this; Choice2Of4 choice2Of2 = (Choice2Of4)fSharpChoice; T2 item5 = choice2Of.item; T2 item6 = choice2Of2.item; return LanguagePrimitives.HashCompare.GenericEqualityWithComparerIntrinsic(comp, item5, item6); } case 2: { Choice3Of4 choice3Of = (Choice3Of4)this; Choice3Of4 choice3Of2 = (Choice3Of4)fSharpChoice; T3 item3 = choice3Of.item; T3 item4 = choice3Of2.item; return LanguagePrimitives.HashCompare.GenericEqualityWithComparerIntrinsic(comp, item3, item4); } case 3: { Choice4Of4 choice4Of = (Choice4Of4)this; Choice4Of4 choice4Of2 = (Choice4Of4)fSharpChoice; T4 item = choice4Of.item; T4 item2 = choice4Of2.item; return LanguagePrimitives.HashCompare.GenericEqualityWithComparerIntrinsic(comp, item, item2); } } } return false; } return false; } return obj == null; } [CompilerGenerated] public virtual sealed bool Equals(FSharpChoice<T1, T2, T3, T4> obj) { if (this != null) { if (obj != null) { int tag = _tag; int tag2 = obj._tag; if (tag == tag2) { switch (Tag) { default: { Choice1Of4 choice1Of = (Choice1Of4)this; Choice1Of4 choice1Of2 = (Choice1Of4)obj; T1 item7 = choice1Of.item; T1 item8 = choice1Of2.item; return LanguagePrimitives.HashCompare.GenericEqualityERIntrinsic(item7, item8); } case 1: { Choice2Of4 choice2Of = (Choice2Of4)this; Choice2Of4 choice2Of2 = (Choice2Of4)obj; T2 item5 = choice2Of.item; T2 item6 = choice2Of2.item; return LanguagePrimitives.HashCompare.GenericEqualityERIntrinsic(item5, item6); } case 2: { Choice3Of4 choice3Of = (Choice3Of4)this; Choice3Of4 choice3Of2 = (Choice3Of4)obj; T3 item3 = choice3Of.item; T3 item4 = choice3Of2.item; return LanguagePrimitives.HashCompare.GenericEqualityERIntrinsic(item3, item4); } case 3: { Choice4Of4 choice4Of = (Choice4Of4)this; Choice4Of4 choice4Of2 = (Choice4Of4)obj; T4 item = choice4Of.item; T4 item2 = choice4Of2.item; return LanguagePrimitives.HashCompare.GenericEqualityERIntrinsic(item, item2); } } } return false; } return false; } return obj == null; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is FSharpChoice<T1, T2, T3, T4> obj2) { return Equals(obj2); } return false; } } [Serializable] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [StructuralEquality] [StructuralComparison] [CompiledName("FSharpChoice`5")] [CompilationMapping(SourceConstructFlags.SumType)] public abstract class FSharpChoice<T1, T2, T3, T4, T5> : IEquatable<FSharpChoice<T1, T2, T3, T4, T5>>, IStructuralEquatable, IComparable<FSharpChoice<T1, T2, T3, T4, T5>>, IComparable, IStructuralComparable { public static class Tags { public const int Choice1Of5 = 0; public const int Choice2Of5 = 1; public const int Choice3Of5 = 2; public const int Choice4Of5 = 3; public const int Choice5Of5 = 4; } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(FSharpChoice<, , , , >.Choice1Of5@DebugTypeProxy))] public class Choice1Of5 : FSharpChoice<T1, T2, T3, T4, T5> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T1 item; [CompilationMapping(SourceConstructFlags.Field, 0, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T1 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , , >))] [CompilerGenerated] [DebuggerNonUserCode] internal Choice1Of5(T1 item) : base(0) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(FSharpChoice<, , , , >.Choice2Of5@DebugTypeProxy))] public class Choice2Of5 : FSharpChoice<T1, T2, T3, T4, T5> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T2 item; [CompilationMapping(SourceConstructFlags.Field, 1, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T2 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , , >))] [CompilerGenerated] [DebuggerNonUserCode] internal Choice2Of5(T2 item) : base(1) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(FSharpChoice<, , , , >.Choice3Of5@DebugTypeProxy))] public class Choice3Of5 : FSharpChoice<T1, T2, T3, T4, T5> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T3 item; [CompilationMapping(SourceConstructFlags.Field, 2, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T3 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , , >))] [CompilerGenerated] [DebuggerNonUserCode] internal Choice3Of5(T3 item) : base(2) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(FSharpChoice<, , , , >.Choice4Of5@DebugTypeProxy))] public class Choice4Of5 : FSharpChoice<T1, T2, T3, T4, T5> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T4 item; [CompilationMapping(SourceConstructFlags.Field, 3, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T4 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , , >))] [CompilerGenerated] [DebuggerNonUserCode] internal Choice4Of5(T4 item) : base(3) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(FSharpChoice<, , , , >.Choice5Of5@DebugTypeProxy))] public class Choice5Of5 : FSharpChoice<T1, T2, T3, T4, T5> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T5 item; [CompilationMapping(SourceConstructFlags.Field, 4, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T5 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , , >))] [CompilerGenerated] [DebuggerNonUserCode] internal Choice5Of5(T5 item) : base(4) { this.item = item; } } [SpecialName] internal class Choice1Of5@DebugTypeProxy { [CompilationMapping(SourceConstructFlags.Field, 0, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T1 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , , >))] [CompilerGenerated] [DebuggerNonUserCode] public Choice1Of5@DebugTypeProxy(Choice1Of5 obj) { _obj = obj; } } [SpecialName] internal class Choice2Of5@DebugTypeProxy { [CompilationMapping(SourceConstructFlags.Field, 1, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T2 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , , >))] [CompilerGenerated] [DebuggerNonUserCode] public Choice2Of5@DebugTypeProxy(Choice2Of5 obj) { _obj = obj; } } [SpecialName] internal class Choice3Of5@DebugTypeProxy { [CompilationMapping(SourceConstructFlags.Field, 2, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T3 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , , >))] [CompilerGenerated] [DebuggerNonUserCode] public Choice3Of5@DebugTypeProxy(Choice3Of5 obj) { _obj = obj; } } [SpecialName] internal class Choice4Of5@DebugTypeProxy { [CompilationMapping(SourceConstructFlags.Field, 3, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T4 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , , >))] [CompilerGenerated] [DebuggerNonUserCode] public Choice4Of5@DebugTypeProxy(Choice4Of5 obj) { _obj = obj; } } [SpecialName] internal class Choice5Of5@DebugTypeProxy { [CompilationMapping(SourceConstructFlags.Field, 4, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T5 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , , >))] [CompilerGenerated] [DebuggerNonUserCode] public Choice5Of5@DebugTypeProxy(Choice5Of5 obj) { _obj = obj; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public int Tag { [DebuggerNonUserCode] get; } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsChoice1Of5 { [CompilerGenerated] [DebuggerNonUserCode] get { return Tag == 0; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsChoice2Of5 { [CompilerGenerated] [DebuggerNonUserCode] get { return Tag == 1; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsChoice3Of5 { [CompilerGenerated] [DebuggerNonUserCode] get { return Tag == 2; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsChoice4Of5 { [CompilerGenerated] [DebuggerNonUserCode] get { return Tag == 3; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsChoice5Of5 { [CompilerGenerated] [DebuggerNonUserCode] get { return Tag == 4; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicNestedTypes | DynamicallyAccessedMemberTypes.NonPublicNestedTypes | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , , >))] [CompilerGenerated] [DebuggerNonUserCode] internal FSharpChoice(int _tag) { this._tag = _tag; } [CompilationMapping(SourceConstructFlags.UnionCase, 0)] public static FSharpChoice<T1, T2, T3, T4, T5> NewChoice1Of5(T1 item) { return new Choice1Of5(item); } [CompilationMapping(SourceConstructFlags.UnionCase, 1)] public static FSharpChoice<T1, T2, T3, T4, T5> NewChoice2Of5(T2 item) { return new Choice2Of5(item); } [CompilationMapping(SourceConstructFlags.UnionCase, 2)] public static FSharpChoice<T1, T2, T3, T4, T5> NewChoice3Of5(T3 item) { return new Choice3Of5(item); } [CompilationMapping(SourceConstructFlags.UnionCase, 3)] public static FSharpChoice<T1, T2, T3, T4, T5> NewChoice4Of5(T4 item) { return new Choice4Of5(item); } [CompilationMapping(SourceConstructFlags.UnionCase, 4)] public static FSharpChoice<T1, T2, T3, T4, T5> NewChoice5Of5(T5 item) { return new Choice5Of5(item); } [CompilerGenerated] public virtual sealed int CompareTo(FSharpChoice<T1, T2, T3, T4, T5> obj) { if (this != null) { if (obj != null) { return $Prim-types.CompareTo$cont@3584(this, obj, null); } return 1; } if (obj != null) { return -1; } return 0; } [CompilerGenerated] public virtual sealed int CompareTo(object obj) { return CompareTo((FSharpChoice<T1, T2, T3, T4, T5>)obj); } [CompilerGenerated] public virtual sealed int CompareTo(object obj, IComparer comp) { FSharpChoice<T1, T2, T3, T4, T5> objTemp = (FSharpChoice<T1, T2, T3, T4, T5>)obj; if (this != null) { return $Prim-types.CompareTo$cont@3584-1(comp, this, obj, objTemp, null); } if ((FSharpChoice<T1, T2, T3, T4, T5>)obj != null) { return -1; } return 0; } [CompilerGenerated] public virtual sealed int GetHashCode(IEqualityComparer comp) { if (this != null) { int num = 0; switch (Tag) { default: { Choice1Of5 choice1Of = (Choice1Of5)this; num = 0; T1 item5 = choice1Of.item; return -1640531527 + (LanguagePrimitives.HashCompare.GenericHashParamObj(comp, item5) + ((num << 6) + (num >> 2))); } case 1: { Choice2Of5 choice2Of = (Choice2Of5)this; num = 1; T2 item4 = choice2Of.item; return -1640531527 + (LanguagePrimitives.HashCompare.GenericHashParamObj(comp, item4) + ((num << 6) + (num >> 2))); } case 2: { Choice3Of5 choice3Of = (Choice3Of5)this; num = 2; T3 item3 = choice3Of.item; return -1640531527 + (LanguagePrimitives.HashCompare.GenericHashParamObj(comp, item3) + ((num << 6) + (num >> 2))); } case 3: { Choice4Of5 choice4Of = (Choice4Of5)this; num = 3; T4 item2 = choice4Of.item; return -1640531527 + (LanguagePrimitives.HashCompare.GenericHashParamObj(comp, item2) + ((num << 6) + (num >> 2))); } case 4: { Choice5Of5 choice5Of = (Choice5Of5)this; num = 4; T5 item = choice5Of.item; return -1640531527 + (LanguagePrimitives.HashCompare.GenericHashParamObj(comp, item) + ((num << 6) + (num >> 2))); } } } return 0; } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public virtual sealed bool Equals(object obj, IEqualityComparer comp) { if (this != null) { return $Prim-types.Equals$cont@3584(this, obj, comp, null); } return obj == null; } [CompilerGenerated] public virtual sealed bool Equals(FSharpChoice<T1, T2, T3, T4, T5> obj) { if (this != null) { if (obj != null) { int tag = _tag; int tag2 = obj._tag; if (tag == tag2) { switch (Tag) { default: { Choice1Of5 choice1Of = (Choice1Of5)this; Choice1Of5 choice1Of2 = (Choice1Of5)obj; T1 item9 = choice1Of.item; T1 item10 = choice1Of2.item; return LanguagePrimitives.HashCompare.GenericEqualityERIntrinsic(item9, item10); } case 1: { Choice2Of5 choice2Of = (Choice2Of5)this; Choice2Of5 choice2Of2 = (Choice2Of5)obj; T2 item7 = choice2Of.item; T2 item8 = choice2Of2.item; return LanguagePrimitives.HashCompare.GenericEqualityERIntrinsic(item7, item8); } case 2: { Choice3Of5 choice3Of = (Choice3Of5)this; Choice3Of5 choice3Of2 = (Choice3Of5)obj; T3 item5 = choice3Of.item; T3 item6 = choice3Of2.item; return LanguagePrimitives.HashCompare.GenericEqualityERIntrinsic(item5, item6); } case 3: { Choice4Of5 choice4Of = (Choice4Of5)this; Choice4Of5 choice4Of2 = (Choice4Of5)obj; T4 item3 = choice4Of.item; T4 item4 = choice4Of2.item; return LanguagePrimitives.HashCompare.GenericEqualityERIntrinsic(item3, item4); } case 4: { Choice5Of5 choice5Of = (Choice5Of5)this; Choice5Of5 choice5Of2 = (Choice5Of5)obj; T5 item = choice5Of.item; T5 item2 = choice5Of2.item; return LanguagePrimitives.HashCompare.GenericEqualityERIntrinsic(item, item2); } } } return false; } return false; } return obj == null; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is FSharpChoice<T1, T2, T3, T4, T5> obj2) { return Equals(obj2); } return false; } } [Serializable] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [StructuralEquality] [StructuralComparison] [CompiledName("FSharpChoice`6")] [CompilationMapping(SourceConstructFlags.SumType)] public abstract class FSharpChoice<T1, T2, T3, T4, T5, T6> : IEquatable<FSharpChoice<T1, T2, T3, T4, T5, T6>>, IStructuralEquatable, IComparable<FSharpChoice<T1, T2, T3, T4, T5, T6>>, IComparable, IStructuralComparable { public static class Tags { public const int Choice1Of6 = 0; public const int Choice2Of6 = 1; public const int Choice3Of6 = 2; public const int Choice4Of6 = 3; public const int Choice5Of6 = 4; public const int Choice6Of6 = 5; } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(FSharpChoice<, , , , , >.Choice1Of6@DebugTypeProxy))] public class Choice1Of6 : FSharpChoice<T1, T2, T3, T4, T5, T6> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T1 item; [CompilationMapping(SourceConstructFlags.Field, 0, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T1 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , , , >))] [CompilerGenerated] [DebuggerNonUserCode] internal Choice1Of6(T1 item) : base(0) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(FSharpChoice<, , , , , >.Choice2Of6@DebugTypeProxy))] public class Choice2Of6 : FSharpChoice<T1, T2, T3, T4, T5, T6> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T2 item; [CompilationMapping(SourceConstructFlags.Field, 1, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T2 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , , , >))] [CompilerGenerated] [DebuggerNonUserCode] internal Choice2Of6(T2 item) : base(1) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(FSharpChoice<, , , , , >.Choice3Of6@DebugTypeProxy))] public class Choice3Of6 : FSharpChoice<T1, T2, T3, T4, T5, T6> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T3 item; [CompilationMapping(SourceConstructFlags.Field, 2, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T3 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , , , >))] [CompilerGenerated] [DebuggerNonUserCode] internal Choice3Of6(T3 item) : base(2) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(FSharpChoice<, , , , , >.Choice4Of6@DebugTypeProxy))] public class Choice4Of6 : FSharpChoice<T1, T2, T3, T4, T5, T6> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T4 item; [CompilationMapping(SourceConstructFlags.Field, 3, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T4 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , , , >))] [CompilerGenerated] [DebuggerNonUserCode] internal Choice4Of6(T4 item) : base(3) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(FSharpChoice<, , , , , >.Choice5Of6@DebugTypeProxy))] public class Choice5Of6 : FSharpChoice<T1, T2, T3, T4, T5, T6> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T5 item; [CompilationMapping(SourceConstructFlags.Field, 4, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T5 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , , , >))] [CompilerGenerated] [DebuggerNonUserCode] internal Choice5Of6(T5 item) : base(4) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(FSharpChoice<, , , , , >.Choice6Of6@DebugTypeProxy))] public class Choice6Of6 : FSharpChoice<T1, T2, T3, T4, T5, T6> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T6 item; [CompilationMapping(SourceConstructFlags.Field, 5, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T6 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , , , >))] [CompilerGenerated] [DebuggerNonUserCode] internal Choice6Of6(T6 item) : base(5) { this.item = item; } } [SpecialName] internal class Choice1Of6@DebugTypeProxy { [CompilationMapping(SourceConstructFlags.Field, 0, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T1 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , , , >))] [CompilerGenerated] [DebuggerNonUserCode] public Choice1Of6@DebugTypeProxy(Choice1Of6 obj) { _obj = obj; } } [SpecialName] internal class Choice2Of6@DebugTypeProxy { [CompilationMapping(SourceConstructFlags.Field, 1, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T2 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , , , >))] [CompilerGenerated] [DebuggerNonUserCode] public Choice2Of6@DebugTypeProxy(Choice2Of6 obj) { _obj = obj; } } [SpecialName] internal class Choice3Of6@DebugTypeProxy { [CompilationMapping(SourceConstructFlags.Field, 2, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T3 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , , , >))] [CompilerGenerated] [DebuggerNonUserCode] public Choice3Of6@DebugTypeProxy(Choice3Of6 obj) { _obj = obj; } } [SpecialName] internal class Choice4Of6@DebugTypeProxy { [CompilationMapping(SourceConstructFlags.Field, 3, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T4 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , , , >))] [CompilerGenerated] [DebuggerNonUserCode] public Choice4Of6@DebugTypeProxy(Choice4Of6 obj) { _obj = obj; } } [SpecialName] internal class Choice5Of6@DebugTypeProxy { [CompilationMapping(SourceConstructFlags.Field, 4, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T5 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , , , >))] [CompilerGenerated] [DebuggerNonUserCode] public Choice5Of6@DebugTypeProxy(Choice5Of6 obj) { _obj = obj; } } [SpecialName] internal class Choice6Of6@DebugTypeProxy { [CompilationMapping(SourceConstructFlags.Field, 5, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T6 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , , , >))] [CompilerGenerated] [DebuggerNonUserCode] public Choice6Of6@DebugTypeProxy(Choice6Of6 obj) { _obj = obj; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public int Tag { [DebuggerNonUserCode] get; } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsChoice1Of6 { [CompilerGenerated] [DebuggerNonUserCode] get { return Tag == 0; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsChoice2Of6 { [CompilerGenerated] [DebuggerNonUserCode] get { return Tag == 1; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsChoice3Of6 { [CompilerGenerated] [DebuggerNonUserCode] get { return Tag == 2; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsChoice4Of6 { [CompilerGenerated] [DebuggerNonUserCode] get { return Tag == 3; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsChoice5Of6 { [CompilerGenerated] [DebuggerNonUserCode] get { return Tag == 4; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsChoice6Of6 { [CompilerGenerated] [DebuggerNonUserCode] get { return Tag == 5; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicNestedTypes | DynamicallyAccessedMemberTypes.NonPublicNestedTypes | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , , , >))] [CompilerGenerated] [DebuggerNonUserCode] internal FSharpChoice(int _tag) { this._tag = _tag; } [CompilationMapping(SourceConstructFlags.UnionCase, 0)] public static FSharpChoice<T1, T2, T3, T4, T5, T6> NewChoice1Of6(T1 item) { return new Choice1Of6(item); } [CompilationMapping(SourceConstructFlags.UnionCase, 1)] public static FSharpChoice<T1, T2, T3, T4, T5, T6> NewChoice2Of6(T2 item) { return new Choice2Of6(item); } [CompilationMapping(SourceConstructFlags.UnionCase, 2)] public static FSharpChoice<T1, T2, T3, T4, T5, T6> NewChoice3Of6(T3 item) { return new Choice3Of6(item); } [CompilationMapping(SourceConstructFlags.UnionCase, 3)] public static FSharpChoice<T1, T2, T3, T4, T5, T6> NewChoice4Of6(T4 item) { return new Choice4Of6(item); } [CompilationMapping(SourceConstructFlags.UnionCase, 4)] public static FSharpChoice<T1, T2, T3, T4, T5, T6> NewChoice5Of6(T5 item) { return new Choice5Of6(item); } [CompilationMapping(SourceConstructFlags.UnionCase, 5)] public static FSharpChoice<T1, T2, T3, T4, T5, T6> NewChoice6Of6(T6 item) { return new Choice6Of6(item); } [CompilerGenerated] public virtual sealed int CompareTo(FSharpChoice<T1, T2, T3, T4, T5, T6> obj) { if (this != null) { if (obj != null) { int tag = _tag; int tag2 = obj._tag; if (tag == tag2) { return $Prim-types.CompareTo$cont@3593-2(this, obj, null); } return tag - tag2; } return 1; } if (obj != null) { return -1; } return 0; } [CompilerGenerated] public virtual sealed int CompareTo(object obj) { return CompareTo((FSharpChoice<T1, T2, T3, T4, T5, T6>)obj); } [CompilerGenerated] public virtual sealed int CompareTo(object obj, IComparer comp) { FSharpChoice<T1, T2, T3, T4, T5, T6> objTemp = (FSharpChoice<T1, T2, T3, T4, T5, T6>)obj; if (this != null) { if ((FSharpChoice<T1, T2, T3, T4, T5, T6>)obj != null) { return $Prim-types.CompareTo$cont@3593-3(comp, this, objTemp, null); } return 1; } if ((FSharpChoice<T1, T2, T3, T4, T5, T6>)obj != null) { return -1; } return 0; } [CompilerGenerated] public virtual sealed int GetHashCode(IEqualityComparer comp) { if (this != null) { return $Prim-types.GetHashCode$cont@3593(comp, this, null); } return 0; } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public virtual sealed bool Equals(object obj, IEqualityComparer comp) { if (this != null) { if (obj is FSharpChoice<T1, T2, T3, T4, T5, T6> that) { return $Prim-types.Equals$cont@3593-1(this, that, comp, null); } return false; } return obj == null; } [CompilerGenerated] public virtual sealed bool Equals(FSharpChoice<T1, T2, T3, T4, T5, T6> obj) { if (this != null) { if (obj != null) { return $Prim-types.Equals$cont@3593-2(this, obj, null); } return false; } return obj == null; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is FSharpChoice<T1, T2, T3, T4, T5, T6> obj2) { return Equals(obj2); } return false; } } [Serializable] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [StructuralEquality] [StructuralComparison] [CompiledName("FSharpChoice`7")] [CompilationMapping(SourceConstructFlags.SumType)] public abstract class FSharpChoice<T1, T2, T3, T4, T5, T6, T7> : IEquatable<FSharpChoice<T1, T2, T3, T4, T5, T6, T7>>, IStructuralEquatable, IComparable<FSharpChoice<T1, T2, T3, T4, T5, T6, T7>>, IComparable, IStructuralComparable { public static class Tags { public const int Choice1Of7 = 0; public const int Choice2Of7 = 1; public const int Choice3Of7 = 2; public const int Choice4Of7 = 3; public const int Choice5Of7 = 4; public const int Choice6Of7 = 5; public const int Choice7Of7 = 6; } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(FSharpChoice<, , , , , , >.Choice1Of7@DebugTypeProxy))] public class Choice1Of7 : FSharpChoice<T1, T2, T3, T4, T5, T6, T7> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T1 item; [CompilationMapping(SourceConstructFlags.Field, 0, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T1 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , , , , >))] [CompilerGenerated] [DebuggerNonUserCode] internal Choice1Of7(T1 item) : base(0) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(FSharpChoice<, , , , , , >.Choice2Of7@DebugTypeProxy))] public class Choice2Of7 : FSharpChoice<T1, T2, T3, T4, T5, T6, T7> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T2 item; [CompilationMapping(SourceConstructFlags.Field, 1, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T2 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , , , , >))] [CompilerGenerated] [DebuggerNonUserCode] internal Choice2Of7(T2 item) : base(1) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(FSharpChoice<, , , , , , >.Choice3Of7@DebugTypeProxy))] public class Choice3Of7 : FSharpChoice<T1, T2, T3, T4, T5, T6, T7> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T3 item; [CompilationMapping(SourceConstructFlags.Field, 2, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T3 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , , , , >))] [CompilerGenerated] [DebuggerNonUserCode] internal Choice3Of7(T3 item) : base(2) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(FSharpChoice<, , , , , , >.Choice4Of7@DebugTypeProxy))] public class Choice4Of7 : FSharpChoice<T1, T2, T3, T4, T5, T6, T7> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T4 item; [CompilationMapping(SourceConstructFlags.Field, 3, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T4 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(FSharpChoice<, , , , , , >))] [CompilerGenerated] [DebuggerNonUserCode] internal Choice4Of7(T4 item) : base(3) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(FSharpChoice<, , , , , , >.Choice5Of7@DebugTypeProxy))] public class Choice5Of7 : FSharpChoice<T1, T2, T3, T4, T5, T6, T7> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T5 item; [CompilationMapping(SourceConstructFlags.Field, 4, 0)] [CompilerGenerated] [DebuggerNonUserCode] public T5 Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberT
BepInEx/core/Mirage.Core/FSharpPlus.dll
Decompiled a month ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.Linq; using System.Numerics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.ExceptionServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Text; using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; using <StartupCode$FSharpPlus>; using FSharpPlus; using FSharpPlus.Control; using FSharpPlus.Data; using FSharpPlus.Internals; using Microsoft.FSharp.Collections; using Microsoft.FSharp.Control; using Microsoft.FSharp.Core; using Microsoft.FSharp.Core.CompilerServices; using Microsoft.FSharp.Quotations; [assembly: FSharpInterfaceDataVersion(2, 0, 0)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")] [assembly: AssemblyCompany("gusty; wallymathieu")] [assembly: AssemblyCopyright("2012-2024 Gustavo M. Wild - Oskar Gewalli (and contributors https://github.com/fsprojects/FSharpPlus/graphs/contributors)")] [assembly: AssemblyInformationalVersion("1.6.1")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/fsprojects/FSharpPlus")] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyVersion("0.0.0.0")] namespace FSharpPlus.Internals { [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class Default6 { } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class Default5 : Default6 { } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class Default4 : Default5 { } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class Default3 : Default4 { } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class Default2 : Default3 { } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class Default1 : Default2 { } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class Id<t> { internal t value; public t getValue => value; public Id(t v) { value = v; } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class Id0 { internal string value; public string getValue => value; public Id0(string v) { value = v; } } [Serializable] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [DebuggerDisplay("{__DebugDisplay(),nq}")] [CompilationMapping(/*Could not decode attribute arguments.*/)] public abstract class Either<t, u> : IEquatable<Either<t, u>>, IStructuralEquatable, IComparable<Either<t, u>>, IComparable, IStructuralComparable { public static class Tags { public const int Left = 0; public const int Right = 1; } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(Either<, >.Left@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] public class Left : Either<t, u> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly t item; [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public t Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [CompilerGenerated] [DebuggerNonUserCode] internal Left(t item) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(Either<, >.Right@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] public class Right : Either<t, u> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly u item; [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public u Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [CompilerGenerated] [DebuggerNonUserCode] internal Right(u item) { this.item = item; } } [SpecialName] internal class Left@DebugTypeProxy { [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public t Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [CompilerGenerated] [DebuggerNonUserCode] public Left@DebugTypeProxy(Left obj) { _obj = obj; } } [SpecialName] internal class Right@DebugTypeProxy { [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public u Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [CompilerGenerated] [DebuggerNonUserCode] public Right@DebugTypeProxy(Right obj) { _obj = obj; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public int Tag { [CompilerGenerated] [DebuggerNonUserCode] get { return (this is Right) ? 1 : 0; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsLeft { [CompilerGenerated] [DebuggerNonUserCode] get { return this is Left; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsRight { [CompilerGenerated] [DebuggerNonUserCode] get { return this is Right; } } [CompilerGenerated] [DebuggerNonUserCode] internal Either() { } [CompilationMapping(/*Could not decode attribute arguments.*/)] public static Either<t, u> NewLeft(t item) { return new Left(item); } [CompilationMapping(/*Could not decode attribute arguments.*/)] public static Either<t, u> NewRight(u item) { return new Right(item); } [SpecialName] [CompilerGenerated] [DebuggerNonUserCode] internal object __DebugDisplay() { return ((FSharpFunc<Either<Either<t, u>, string>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<Either<t, u>, string>>((PrintfFormat<FSharpFunc<Either<t, u>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<Either<FSharpFunc<Either<t, u>, string>, Unit>, string>, Unit, string, string, string>("%+0.8A"))).Invoke((Either<Either<t, u>, string>)(object)this); } [CompilerGenerated] public override string ToString() { return ((FSharpFunc<Either<Either<t, u>, string>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<Either<t, u>, string>>((PrintfFormat<FSharpFunc<Either<t, u>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<Either<FSharpFunc<Either<t, u>, string>, Unit>, string>, Unit, string, string, Either<FSharpFunc<Either<t, u>, string>, Unit>>("%+A"))).Invoke((Either<Either<t, u>, string>)(object)this); } [CompilerGenerated] public virtual sealed int CompareTo(Either<t, u> obj) { if (this != null) { if (obj != null) { int num = ((this is Right) ? 1 : 0); int num2 = ((obj is Right) ? 1 : 0); if (num == num2) { IComparer genericComparer; if (this is Left) { Left left = (Left)this; Left left2 = (Left)obj; genericComparer = LanguagePrimitives.GenericComparer; t item = left.item; t item2 = left2.item; return HashCompare.GenericComparisonWithComparerIntrinsic<t>(genericComparer, item, item2); } Right right = (Right)this; Right right2 = (Right)obj; genericComparer = LanguagePrimitives.GenericComparer; u item3 = right.item; u item4 = right2.item; return HashCompare.GenericComparisonWithComparerIntrinsic<u>(genericComparer, item3, item4); } return num - num2; } return 1; } if (obj != null) { return -1; } return 0; } [CompilerGenerated] public virtual sealed int CompareTo(object obj) { return CompareTo((Either<t, u>)obj); } [CompilerGenerated] public virtual sealed int CompareTo(object obj, IComparer comp) { Either<t, u> either = (Either<t, u>)obj; if (this != null) { if ((Either<t, u>)obj != null) { int num = ((this is Right) ? 1 : 0); Either<t, u> either2 = either; int num2 = ((either2 is Right) ? 1 : 0); if (num == num2) { if (this is Left) { Left left = (Left)this; Left left2 = (Left)either; t item = left.item; t item2 = left2.item; return HashCompare.GenericComparisonWithComparerIntrinsic<t>(comp, item, item2); } Right right = (Right)this; Right right2 = (Right)either; u item3 = right.item; u item4 = right2.item; return HashCompare.GenericComparisonWithComparerIntrinsic<u>(comp, item3, item4); } return num - num2; } return 1; } if ((Either<t, u>)obj != null) { return -1; } return 0; } [CompilerGenerated] public virtual sealed int GetHashCode(IEqualityComparer comp) { if (this != null) { int num = 0; if (this is Left) { Left left = (Left)this; num = 0; t item = left.item; return -1640531527 + (HashCompare.GenericHashWithComparerIntrinsic<t>(comp, item) + ((num << 6) + (num >> 2))); } Right right = (Right)this; num = 1; u item2 = right.item; return -1640531527 + (HashCompare.GenericHashWithComparerIntrinsic<u>(comp, item2) + ((num << 6) + (num >> 2))); } return 0; } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public virtual sealed bool Equals(object obj, IEqualityComparer comp) { if (this != null) { if (obj is Either<t, u> either) { int num = ((this is Right) ? 1 : 0); Either<t, u> either2 = either; int num2 = ((either2 is Right) ? 1 : 0); if (num == num2) { if (this is Left) { Left left = (Left)this; Left left2 = (Left)either; t item = left.item; t item2 = left2.item; return HashCompare.GenericEqualityWithComparerIntrinsic<t>(comp, item, item2); } Right right = (Right)this; Right right2 = (Right)either; u item3 = right.item; u item4 = right2.item; return HashCompare.GenericEqualityWithComparerIntrinsic<u>(comp, item3, item4); } return false; } return false; } return obj == null; } [CompilerGenerated] public virtual sealed bool Equals(Either<t, u> obj) { if (this != null) { if (obj != null) { int num = ((this is Right) ? 1 : 0); int num2 = ((obj is Right) ? 1 : 0); if (num == num2) { if (this is Left) { Left left = (Left)this; Left left2 = (Left)obj; t item = left.item; t item2 = left2.item; return HashCompare.GenericEqualityERIntrinsic<t>(item, item2); } Right right = (Right)this; Right right2 = (Right)obj; u item3 = right.item; u item4 = right2.item; return HashCompare.GenericEqualityERIntrinsic<u>(item3, item4); } return false; } return false; } return obj == null; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is Either<t, u> obj2) { return Equals(obj2); } return false; } } [Serializable] [StructLayout(LayoutKind.Sequential, Size = 1)] [CompilationMapping(/*Could not decode attribute arguments.*/)] public struct DmStruct : IEquatable<DmStruct>, IStructuralEquatable, IComparable<DmStruct>, IComparable, IStructuralComparable { [CompilerGenerated] public sealed int CompareTo(DmStruct obj) { return 0; } [CompilerGenerated] public sealed int CompareTo(object obj) { DmStruct dmStruct = (DmStruct)obj; return 0; } [CompilerGenerated] public sealed int CompareTo(object obj, IComparer comp) { DmStruct dmStruct = (DmStruct)obj; return 0; } [CompilerGenerated] public sealed int GetHashCode(IEqualityComparer comp) { return 0; } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public sealed bool Equals(object obj, IEqualityComparer comp) { if (obj is DmStruct) { return true; } return false; } [CompilerGenerated] public sealed bool Equals(DmStruct obj) { return true; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is DmStruct) { return true; } return false; } } [Serializable] [StructLayout(LayoutKind.Sequential, Size = 1)] [CompilationMapping(/*Could not decode attribute arguments.*/)] public struct DmStruct1<T1> : IEquatable<DmStruct1<T1>>, IStructuralEquatable, IComparable<DmStruct1<T1>>, IComparable, IStructuralComparable { [CompilerGenerated] public sealed int CompareTo(DmStruct1<T1> obj) { return 0; } [CompilerGenerated] public sealed int CompareTo(object obj) { DmStruct1<T1> dmStruct = (DmStruct1<T1>)obj; return 0; } [CompilerGenerated] public sealed int CompareTo(object obj, IComparer comp) { DmStruct1<T1> dmStruct = (DmStruct1<T1>)obj; return 0; } [CompilerGenerated] public sealed int GetHashCode(IEqualityComparer comp) { return 0; } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public sealed bool Equals(object obj, IEqualityComparer comp) { if (obj is DmStruct1<T1>) { return true; } return false; } [CompilerGenerated] public sealed bool Equals(DmStruct1<T1> obj) { return true; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is DmStruct1<T1>) { return true; } return false; } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public struct KeyValuePair2<TKey, TValue> : IEquatable<KeyValuePair2<TKey, TValue>>, IStructuralEquatable, IComparable<KeyValuePair2<TKey, TValue>>, IComparable, IStructuralComparable { internal TKey Key@; internal TValue Value@; [CompilationMapping(/*Could not decode attribute arguments.*/)] public TKey Key => Key@; [CompilationMapping(/*Could not decode attribute arguments.*/)] public TValue Value => Value@; [CompilerGenerated] public sealed int CompareTo(KeyValuePair2<TKey, TValue> obj) { IComparer genericComparer = LanguagePrimitives.GenericComparer; TKey key@ = Key@; TKey key@2 = obj.Key@; int num = HashCompare.GenericComparisonWithComparerIntrinsic<TKey>(genericComparer, key@, key@2); if (num < 0) { return num; } if (num > 0) { return num; } genericComparer = LanguagePrimitives.GenericComparer; TValue value@ = Value@; TValue value@2 = obj.Value@; return HashCompare.GenericComparisonWithComparerIntrinsic<TValue>(genericComparer, value@, value@2); } [CompilerGenerated] public sealed int CompareTo(object obj) { return CompareTo((KeyValuePair2<TKey, TValue>)obj); } [CompilerGenerated] public sealed int CompareTo(object obj, IComparer comp) { KeyValuePair2<TKey, TValue> keyValuePair = (KeyValuePair2<TKey, TValue>)obj; TKey key@ = Key@; TKey key@2 = keyValuePair.Key@; int num = HashCompare.GenericComparisonWithComparerIntrinsic<TKey>(comp, key@, key@2); if (num < 0) { return num; } if (num > 0) { return num; } TValue value@ = Value@; TValue value@2 = keyValuePair.Value@; return HashCompare.GenericComparisonWithComparerIntrinsic<TValue>(comp, value@, value@2); } [CompilerGenerated] public sealed int GetHashCode(IEqualityComparer comp) { int num = 0; TValue value@ = Value@; num = -1640531527 + (HashCompare.GenericHashWithComparerIntrinsic<TValue>(comp, value@) + ((num << 6) + (num >> 2))); TKey key@ = Key@; return -1640531527 + (HashCompare.GenericHashWithComparerIntrinsic<TKey>(comp, key@) + ((num << 6) + (num >> 2))); } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public sealed bool Equals(object obj, IEqualityComparer comp) { if (obj is KeyValuePair2<TKey, TValue> keyValuePair) { TKey key@ = Key@; TKey key@2 = keyValuePair.Key@; if (HashCompare.GenericEqualityWithComparerIntrinsic<TKey>(comp, key@, key@2)) { TValue value@ = Value@; TValue value@2 = keyValuePair.Value@; return HashCompare.GenericEqualityWithComparerIntrinsic<TValue>(comp, value@, value@2); } return false; } return false; } public KeyValuePair2(TKey key, TValue value) { Key@ = key; Value@ = value; } [CompilerGenerated] public sealed bool Equals(KeyValuePair2<TKey, TValue> obj) { TKey key@ = Key@; TKey key@2 = obj.Key@; if (HashCompare.GenericEqualityERIntrinsic<TKey>(key@, key@2)) { TValue value@ = Value@; TValue value@2 = obj.Value@; return HashCompare.GenericEqualityERIntrinsic<TValue>(value@, value@2); } return false; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is KeyValuePair2<TKey, TValue>) { return Equals((KeyValuePair2<TKey, TValue>)obj); } return false; } } [Serializable] [Sealed] [CompilationMapping(/*Could not decode attribute arguments.*/)] public sealed class Set2<T> { } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class BitConverter { public static byte[] GetBytes(bool value) { return new byte[1] { (byte)(value ? 1 : 0) }; } public static byte[] GetBytes(char value, bool isLittleEndian) { return GetBytes((short)value, isLittleEndian); } public unsafe static byte[] GetBytes(short value, bool isLittleEndian) { //The blocks IL_004a are reachable both inside and outside the pinned region starting at IL_003c. ILSpy has duplicated these blocks in order to place them both within and outside the `fixed` statement. if (!isLittleEndian) { return new byte[2] { (byte)(short)(value >> 8), (byte)value }; } byte[] array = ArrayModule.ZeroCreate<byte>(2); nint num; IntPtr intPtr; if (array != null) { if (ArrayModule.Length<byte>(array) != 0) { fixed (byte* ptr = &array[0]) { num = (intPtr = (nint)ptr); *(short*)intPtr = value; return array; } } num = 0; } else { num = 0; } intPtr = num; *(short*)intPtr = value; return array; } public unsafe static byte[] GetBytes(int value, bool isLittleEndian) { //The blocks IL_0061 are reachable both inside and outside the pinned region starting at IL_0053. ILSpy has duplicated these blocks in order to place them both within and outside the `fixed` statement. if (!isLittleEndian) { return new byte[4] { (byte)(value >> 24), (byte)(value >> 16), (byte)(value >> 8), (byte)value }; } byte[] array = ArrayModule.ZeroCreate<byte>(4); nint num; IntPtr intPtr; if (array != null) { if (ArrayModule.Length<byte>(array) != 0) { fixed (byte* ptr = &array[0]) { num = (intPtr = (nint)ptr); *(int*)intPtr = value; return array; } } num = 0; } else { num = 0; } intPtr = num; *(int*)intPtr = value; return array; } public unsafe static byte[] GetBytes(long value, bool isLittleEndian) { //The blocks IL_0091 are reachable both inside and outside the pinned region starting at IL_0083. ILSpy has duplicated these blocks in order to place them both within and outside the `fixed` statement. if (!isLittleEndian) { return new byte[8] { (byte)(value >> 56), (byte)(value >> 48), (byte)(value >> 40), (byte)(value >> 32), (byte)(value >> 24), (byte)(value >> 16), (byte)(value >> 8), (byte)value }; } byte[] array = ArrayModule.ZeroCreate<byte>(8); nint num; IntPtr intPtr; if (array != null) { if (ArrayModule.Length<byte>(array) != 0) { fixed (byte* ptr = &array[0]) { num = (intPtr = (nint)ptr); *(long*)intPtr = value; return array; } } num = 0; } else { num = 0; } intPtr = num; *(long*)intPtr = value; return array; } public static byte[] GetBytes(ushort value, bool isLittleEndian) { return GetBytes((short)value, isLittleEndian); } public static byte[] GetBytes(uint value, bool isLittleEndian) { return GetBytes((int)value, isLittleEndian); } public static byte[] GetBytes(ulong value, bool isLittleEndian) { return GetBytes((long)value, isLittleEndian); } public unsafe static byte[] GetBytes(float value, bool isLittleEndian) { float num = value; return GetBytes(*(int*)(&num), isLittleEndian); } public unsafe static byte[] GetBytes(double value, bool isLittleEndian) { double num = value; return GetBytes(*(long*)(&num), isLittleEndian); } public static byte[] GetBytes(Guid value, bool isLittleEndian) { byte[] array = value.ToByteArray(); if (isLittleEndian) { return array; } return $Internals.GetBytes$cont@204(array, null); } public static char ToChar(byte[] value, int startIndex, bool isLittleEndian) { return (char)ToInt16(value, startIndex, isLittleEndian); } public unsafe static short ToInt16(byte[] value, int startIndex, bool isLittleEndian) { if (value == null) { throw new ArgumentNullException("value"); } if (startIndex >= value.Length) { ArgumentOutOfRangeException ex = new ArgumentOutOfRangeException("startIndex", "ArgumentOutOfRange_Index"); throw ex; } if (startIndex > value.Length - 2) { ArgumentException ex2 = new ArgumentException("Arg_ArrayPlusOffTooSmall"); throw ex2; } fixed (byte* ptr = &value[startIndex]) { nint num = (nint)ptr; short num3; if (isLittleEndian) { if (startIndex % 2 == 0) { return *(short*)num; } short num2 = *(byte*)(num + (nint)0 * (nint)sizeof(byte)); num3 = *(byte*)(num + (nint)1 * (nint)sizeof(byte)); return (short)(num2 | (short)(num3 << 8)); } num3 = *(byte*)(num + (nint)0 * (nint)sizeof(byte)); return (short)((short)(num3 << 8) | (short)(*(byte*)(num + (nint)1 * (nint)sizeof(byte)))); } } public unsafe static int ToInt32(byte[] value, int startIndex, bool isLittleEndian) { if (value == null) { throw new ArgumentNullException("value"); } if (startIndex >= value.Length) { ArgumentOutOfRangeException ex = new ArgumentOutOfRangeException("startIndex", "ArgumentOutOfRange_Index"); throw ex; } if (startIndex > value.Length - 4) { ArgumentException ex2 = new ArgumentException("Arg_ArrayPlusOffTooSmall"); throw ex2; } fixed (byte* ptr = &value[startIndex]) { nint num = (nint)ptr; if (isLittleEndian) { if (startIndex % 4 == 0) { return *(int*)num; } return *(byte*)(num + (nint)0 * (nint)sizeof(byte)) | (*(byte*)(num + (nint)1 * (nint)sizeof(byte)) << 8) | (*(byte*)(num + (nint)2 * (nint)sizeof(byte)) << 16) | (*(byte*)(num + (nint)3 * (nint)sizeof(byte)) << 24); } return (*(byte*)(num + (nint)0 * (nint)sizeof(byte)) << 24) | (*(byte*)(num + (nint)1 * (nint)sizeof(byte)) << 16) | (*(byte*)(num + (nint)2 * (nint)sizeof(byte)) << 8) | *(byte*)(num + (nint)3 * (nint)sizeof(byte)); } } public unsafe static long ToInt64(byte[] value, int startIndex, bool isLittleEndian) { if (value == null) { throw new ArgumentNullException("value"); } if (startIndex >= value.Length) { ArgumentOutOfRangeException ex = new ArgumentOutOfRangeException("startIndex", "ArgumentOutOfRange_Index"); throw ex; } if (startIndex > value.Length - 8) { ArgumentException ex2 = new ArgumentException("Arg_ArrayPlusOffTooSmall"); throw ex2; } fixed (byte* ptr = &value[startIndex]) { nint num = (nint)ptr; long num2; if (isLittleEndian) { if (startIndex % 8 == 0) { return *(long*)num; } num2 = (long)(*(byte*)(num + (nint)0 * (nint)sizeof(byte)) | ((ulong)(*(byte*)(num + (nint)1 * (nint)sizeof(byte))) << 8) | ((ulong)(*(byte*)(num + (nint)2 * (nint)sizeof(byte))) << 16) | ((ulong)(*(byte*)(num + (nint)3 * (nint)sizeof(byte))) << 24)); long num3 = (long)(*(byte*)(num + (nint)4 * (nint)sizeof(byte)) | ((ulong)(*(byte*)(num + (nint)5 * (nint)sizeof(byte))) << 8) | ((ulong)(*(byte*)(num + (nint)6 * (nint)sizeof(byte))) << 16) | ((ulong)(*(byte*)(num + (nint)7 * (nint)sizeof(byte))) << 24)); return num2 | (num3 << 32); } num2 = (long)(((ulong)(*(byte*)(num + (nint)0 * (nint)sizeof(byte))) << 24) | ((ulong)(*(byte*)(num + (nint)1 * (nint)sizeof(byte))) << 16) | ((ulong)(*(byte*)(num + (nint)2 * (nint)sizeof(byte))) << 8) | *(byte*)(num + (nint)3 * (nint)sizeof(byte))); return (long)(((ulong)(*(byte*)(num + (nint)4 * (nint)sizeof(byte))) << 24) | ((ulong)(*(byte*)(num + (nint)5 * (nint)sizeof(byte))) << 16) | ((ulong)(*(byte*)(num + (nint)6 * (nint)sizeof(byte))) << 8) | *(byte*)(num + (nint)7 * (nint)sizeof(byte))) | (num2 << 32); } } public static Guid ToGuid(byte[] value, int startIndex, bool isLittleEndian) { if (value == null) { throw new ArgumentNullException("value"); } if (startIndex >= value.Length) { ArgumentOutOfRangeException ex = new ArgumentOutOfRangeException("startIndex", "ArgumentOutOfRange_Index"); throw ex; } if (startIndex > value.Length - 16) { ArgumentException ex2 = new ArgumentException("Arg_ArrayPlusOffTooSmall"); throw ex2; } if (isLittleEndian) { if (startIndex == 0) { return new Guid(value); } int num = startIndex + 15; int num2 = value.Length; int num3 = ((startIndex >= 0) ? startIndex : 0); int num4 = ((num >= 0 + num2) ? (0 + num2 - 1) : num); int num5 = num4 - num3 + 1; int num6 = ((num5 >= 0) ? num5 : 0); byte[] array = new byte[num6]; int num7 = 0; int num8 = num6 - 1; if (num8 >= num7) { do { array[num7] = value[num3 + num7]; num7++; } while (num7 != num8 + 1); } return new Guid(array); } return $Internals.ToGuid$cont@264(value, startIndex, null); } public static ushort ToUInt16(byte[] value, int startIndex, bool isLittleEndian) { return (ushort)ToInt16(value, startIndex, isLittleEndian); } public static uint ToUInt32(byte[] value, int startIndex, bool isLittleEndian) { return (uint)ToInt32(value, startIndex, isLittleEndian); } public static ulong ToUInt64(byte[] value, int startIndex, bool isLittleEndian) { return (ulong)ToInt64(value, startIndex, isLittleEndian); } public unsafe static float ToSingle(byte[] value, int startIndex, bool isLittleEndian) { int num = ToInt32(value, startIndex, isLittleEndian); return *(float*)(&num); } public unsafe static double ToDouble(byte[] value, int startIndex, bool isLittleEndian) { long num = ToInt64(value, startIndex, isLittleEndian); return *(double*)(&num); } internal static char GetHexValue(int i) { char c; if (i < 10) { c = (char)i; return (char)(c + 48); } c = (char)(i - 10); return (char)(c + 65); } public static string ToString(byte[] value, int startIndex, int length) { if (value == null) { throw new ArgumentNullException("value"); } int num = value.Length; if (startIndex >= value.Length) { ArgumentOutOfRangeException ex = new ArgumentOutOfRangeException("startIndex", "ArgumentOutOfRange_StartIndex"); throw ex; } if (length < 0) { ArgumentOutOfRangeException ex = new ArgumentOutOfRangeException("length", "ArgumentOutOfRange_GenericPositive"); throw ex; } if (startIndex > num - length) { ArgumentException ex2 = new ArgumentException("Arg_ArrayPlusOffTooSmall"); throw ex2; } if (length == 0) { return string.Empty; } char[] array = ArrayModule.ZeroCreate<char>(length * 3); int num2 = startIndex; IEnumerable<int> enumerable = OperatorIntrinsics.RangeInt32(0, 3, 3 * length - 1); foreach (int item in enumerable) { int num3 = value[num2]; num2++; array[item] = GetHexValue(num3 / 16); array[item + 1] = GetHexValue(num3 % 16); array[item + 2] = '-'; } return new string(array, 0, array.Length - 1); } public static string ToString(byte[] value) { if (value == null) { throw new ArgumentNullException("value"); } return ToString(value, 0, value.Length); } public static string ToString(byte[] value, int startIndex) { if (value == null) { throw new ArgumentNullException("value"); } return ToString(value, startIndex, value.Length - startIndex); } } } namespace FSharpPlus.Data { [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public interface NonEmptySeq<T> : IEnumerable<T> { T First { get; } } } namespace FSharpPlus.Control { [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class Explicit : Default1 { public static FSharpFunc<t, R> Explicit<R, t>(R _arg1, Default1 _arg2) { return $Converter.Explicit@18<R, t>.@_instance; } public static FSharpFunc<t, R> Explicit$W<R, t>(FSharpFunc<t, R> op_Explicit, R _arg1, Default1 _arg2) { return new $Converter.Explicit@18-1<R, t>(op_Explicit); } public static void Explicit<t>(t _arg3, Default1 _arg4) where t : class { } public static FSharpFunc<a, byte> Explicit<a>(byte _arg5, Explicit _arg6) { return $Converter.Explicit@21-2<a>.@_instance; } public static FSharpFunc<a, byte> Explicit$W<a>(FSharpFunc<a, byte> op_Explicit, byte _arg5, Explicit _arg6) { return new $Converter.Explicit@21-3<a>(op_Explicit); } public static FSharpFunc<a, sbyte> Explicit<a>(sbyte _arg7, Explicit _arg8) { return $Converter.Explicit@22-4<a>.@_instance; } public static FSharpFunc<a, sbyte> Explicit$W<a>(FSharpFunc<a, sbyte> op_Explicit, sbyte _arg7, Explicit _arg8) { return new $Converter.Explicit@22-5<a>(op_Explicit); } public static FSharpFunc<a, short> Explicit<a>(short _arg9, Explicit _arg10) { return $Converter.Explicit@23-6<a>.@_instance; } public static FSharpFunc<a, short> Explicit$W<a>(FSharpFunc<a, short> op_Explicit, short _arg9, Explicit _arg10) { return new $Converter.Explicit@23-7<a>(op_Explicit); } public static FSharpFunc<a, ushort> Explicit<a>(ushort _arg11, Explicit _arg12) { return $Converter.Explicit@24-8<a>.@_instance; } public static FSharpFunc<a, ushort> Explicit$W<a>(FSharpFunc<a, ushort> op_Explicit, ushort _arg11, Explicit _arg12) { return new $Converter.Explicit@24-9<a>(op_Explicit); } public static FSharpFunc<a, int> Explicit<a>(int _arg13, Explicit _arg14) { return $Converter.Explicit@25-10<a>.@_instance; } public static FSharpFunc<a, int> Explicit$W<a>(FSharpFunc<a, int> op_Explicit, int _arg13, Explicit _arg14) { return new $Converter.Explicit@25-11<a>(op_Explicit); } public static FSharpFunc<a, uint> Explicit<a>(uint _arg15, Explicit _arg16) { return $Converter.Explicit@26-12<a>.@_instance; } public static FSharpFunc<a, uint> Explicit$W<a>(FSharpFunc<a, uint> op_Explicit, uint _arg15, Explicit _arg16) { return new $Converter.Explicit@26-13<a>(op_Explicit); } public static FSharpFunc<a, long> Explicit<a>(long _arg17, Explicit _arg18) { return $Converter.Explicit@27-14<a>.@_instance; } public static FSharpFunc<a, long> Explicit$W<a>(FSharpFunc<a, long> op_Explicit, long _arg17, Explicit _arg18) { return new $Converter.Explicit@27-15<a>(op_Explicit); } public static FSharpFunc<a, ulong> Explicit<a>(ulong _arg19, Explicit _arg20) { return $Converter.Explicit@28-16<a>.@_instance; } public static FSharpFunc<a, ulong> Explicit$W<a>(FSharpFunc<a, ulong> op_Explicit, ulong _arg19, Explicit _arg20) { return new $Converter.Explicit@28-17<a>(op_Explicit); } public static FSharpFunc<a, IntPtr> Explicit<a>(IntPtr _arg21, Explicit _arg22) { return $Converter.Explicit@30-18<a>.@_instance; } public static FSharpFunc<a, IntPtr> Explicit$W<a>(FSharpFunc<a, int> op_Explicit, IntPtr _arg21, Explicit _arg22) { return new $Converter.Explicit@30-19<a>(op_Explicit); } public static FSharpFunc<a, UIntPtr> Explicit<a>(UIntPtr _arg23, Explicit _arg24) { return $Converter.Explicit@31-20<a>.@_instance; } public static FSharpFunc<a, UIntPtr> Explicit$W<a>(FSharpFunc<a, uint> op_Explicit, UIntPtr _arg23, Explicit _arg24) { return new $Converter.Explicit@31-21<a>(op_Explicit); } public static FSharpFunc<a, double> Explicit<a>(double _arg25, Explicit _arg26) { return $Converter.Explicit@33-22<a>.@_instance; } public static FSharpFunc<a, double> Explicit$W<a>(FSharpFunc<a, double> op_Explicit, double _arg25, Explicit _arg26) { return new $Converter.Explicit@33-23<a>(op_Explicit); } public static FSharpFunc<a, float> Explicit<a>(float _arg27, Explicit _arg28) { return $Converter.Explicit@34-24<a>.@_instance; } public static FSharpFunc<a, float> Explicit$W<a>(FSharpFunc<a, float> op_Explicit, float _arg27, Explicit _arg28) { return new $Converter.Explicit@34-25<a>(op_Explicit); } public static FSharpFunc<a, decimal> Explicit<a>(decimal _arg29, Explicit _arg30) { return $Converter.Explicit@35-26<a>.@_instance; } public static FSharpFunc<a, decimal> Explicit$W<a>(FSharpFunc<a, decimal> op_Explicit, decimal _arg29, Explicit _arg30) { return new $Converter.Explicit@35-27<a>(op_Explicit); } public static FSharpFunc<a, char> Explicit<a>(char _arg31, Explicit _arg32) { return $Converter.Explicit@36-28<a>.@_instance; } public static FSharpFunc<a, char> Explicit$W<a>(FSharpFunc<a, char> op_Explicit, char _arg31, Explicit _arg32) { return new $Converter.Explicit@36-29<a>(op_Explicit); } public static T Invoke<a, T>(a value) { Explicit item = null; return FSharpFunc<Tuple<FSharpPlus.Control.Explicit, ?>, T>.InvokeFast<T>((FSharpFunc<Tuple<Explicit, ?>, FSharpFunc<T, T>>)(object)$Converter.Invoke@40<a, T>.@_instance, (Tuple<Explicit, ?>)(object)new Tuple<Explicit, T>(item, default(T)), (T)value); } public static T Invoke$W<a, T>(FSharpFunc<T, FSharpFunc<Explicit, FSharpFunc<a, T>>> @explicit, a value) { Explicit item = null; return FSharpFunc<Tuple<FSharpPlus.Control.Explicit, ?>, T>.InvokeFast<T>((FSharpFunc<Tuple<Explicit, ?>, FSharpFunc<T, T>>)(object)new $Converter.Invoke@40-1<a, T>(@explicit), (Tuple<Explicit, ?>)(object)new Tuple<Explicit, T>(item, default(T)), (T)value); } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class OfBytes { public static FSharpFunc<Tuple<byte[], int, a>, bool> OfBytes<a>(bool _arg1, OfBytes _arg2) { return $Converter.OfBytes@43<a>.@_instance; } public static FSharpFunc<Tuple<byte[], int, bool>, char> OfBytes(char _arg3, OfBytes _arg4) { return $Converter.OfBytes@45-1.@_instance; } public static FSharpFunc<Tuple<byte[], int, bool>, double> OfBytes(double _arg5, OfBytes _arg6) { return $Converter.OfBytes@46-2.@_instance; } public static FSharpFunc<Tuple<byte[], int, bool>, short> OfBytes(short _arg7, OfBytes _arg8) { return $Converter.OfBytes@47-3.@_instance; } public static FSharpFunc<Tuple<byte[], int, bool>, int> OfBytes(int _arg9, OfBytes _arg10) { return $Converter.OfBytes@48-4.@_instance; } public static FSharpFunc<Tuple<byte[], int, bool>, long> OfBytes(long _arg11, OfBytes _arg12) { return $Converter.OfBytes@49-5.@_instance; } public static FSharpFunc<Tuple<byte[], int, bool>, float> OfBytes(float _arg13, OfBytes _arg14) { return $Converter.OfBytes@50-6.@_instance; } public static FSharpFunc<Tuple<byte[], int, b>, string> OfBytes<b>(string _arg15, OfBytes _arg16) { return $Converter.OfBytes@52-7<b>.@_instance; } public static FSharpFunc<Tuple<byte[], int, bool>, Guid> OfBytes(Guid _arg17, OfBytes _arg18) { return $Converter.OfBytes@53-8.@_instance; } public static FSharpFunc<Tuple<byte[], int, bool>, ushort> OfBytes(ushort _arg19, OfBytes _arg20) { return $Converter.OfBytes@55-9.@_instance; } public static FSharpFunc<Tuple<byte[], int, bool>, uint> OfBytes(uint _arg21, OfBytes _arg22) { return $Converter.OfBytes@56-10.@_instance; } public static FSharpFunc<Tuple<byte[], int, bool>, ulong> OfBytes(ulong _arg23, OfBytes _arg24) { return $Converter.OfBytes@57-11.@_instance; } [CompilationArgumentCounts(new int[] { 1, 1, 1 })] public static a Invoke<a>(bool isLtEndian, int startIndex, byte[] value) { OfBytes item = null; Tuple<byte[], int, bool> tuple = new Tuple<byte[], int, bool>(value, startIndex, isLtEndian); return FSharpFunc<Tuple<FSharpPlus.Control.OfBytes, a>, Tuple<byte[], int, bool>>.InvokeFast<a>((FSharpFunc<Tuple<OfBytes, a>, FSharpFunc<Tuple<byte[], int, bool>, a>>)$Converter.Invoke@62-2<a>.@_instance, new Tuple<OfBytes, a>(item, default(a)), tuple); } [CompilationArgumentCounts(new int[] { 1, 1, 1 })] public static a Invoke$W<a>(FSharpFunc<a, FSharpFunc<OfBytes, FSharpFunc<Tuple<byte[], int, bool>, a>>> ofBytes, bool isLtEndian, int startIndex, byte[] value) { OfBytes item = null; Tuple<byte[], int, bool> tuple = new Tuple<byte[], int, bool>(value, startIndex, isLtEndian); return FSharpFunc<Tuple<FSharpPlus.Control.OfBytes, a>, Tuple<byte[], int, bool>>.InvokeFast<a>((FSharpFunc<Tuple<OfBytes, a>, FSharpFunc<Tuple<byte[], int, bool>, a>>)new $Converter.Invoke@62-3<a>(ofBytes), new Tuple<OfBytes, a>(item, default(a)), tuple); } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class ToBytes { public static byte[] ToBytes<a>(bool x, a _arg1, ToBytes _arg2) { return new byte[1] { (byte)(x ? 1 : 0) }; } public static byte[] ToBytes(char x, bool e, ToBytes _arg3) { bool isLittleEndian = System.BitConverter.IsLittleEndian == e; return FSharpPlus.Internals.BitConverter.GetBytes((short)x, isLittleEndian); } public unsafe static byte[] ToBytes(double x, bool e, ToBytes _arg4) { bool isLittleEndian = System.BitConverter.IsLittleEndian == e; double num = x; return FSharpPlus.Internals.BitConverter.GetBytes(*(long*)(&num), isLittleEndian); } public static byte[] ToBytes(short x, bool e, ToBytes _arg5) { return FSharpPlus.Internals.BitConverter.GetBytes(x, System.BitConverter.IsLittleEndian == e); } public static byte[] ToBytes(int x, bool e, ToBytes _arg6) { return FSharpPlus.Internals.BitConverter.GetBytes(x, System.BitConverter.IsLittleEndian == e); } public static byte[] ToBytes(long x, bool e, ToBytes _arg7) { return FSharpPlus.Internals.BitConverter.GetBytes(x, System.BitConverter.IsLittleEndian == e); } public unsafe static byte[] ToBytes(float x, bool e, ToBytes _arg8) { bool isLittleEndian = System.BitConverter.IsLittleEndian == e; float num = x; return FSharpPlus.Internals.BitConverter.GetBytes(*(int*)(&num), isLittleEndian); } public static byte[] ToBytes<b>(string x, b _arg9, ToBytes _arg10) { char[] array = x.ToCharArray(); if (array == null) { throw new ArgumentNullException("array"); } byte[] array2 = new byte[array.Length]; for (int i = 0; i < array2.Length; i++) { array2[i] = (byte)array[i]; } return array2; } public static byte[] ToBytes(Guid x, bool e, ToBytes _arg11) { return FSharpPlus.Internals.BitConverter.GetBytes(x, System.BitConverter.IsLittleEndian == e); } public static byte[] ToBytes(ushort x, bool e, ToBytes _arg12) { bool isLittleEndian = System.BitConverter.IsLittleEndian == e; return FSharpPlus.Internals.BitConverter.GetBytes((short)x, isLittleEndian); } public static byte[] ToBytes(uint x, bool e, ToBytes _arg13) { bool isLittleEndian = System.BitConverter.IsLittleEndian == e; return FSharpPlus.Internals.BitConverter.GetBytes((int)x, isLittleEndian); } public static byte[] ToBytes(ulong x, bool e, ToBytes _arg14) { bool isLittleEndian = System.BitConverter.IsLittleEndian == e; return FSharpPlus.Internals.BitConverter.GetBytes((long)x, isLittleEndian); } [CompilationArgumentCounts(new int[] { 1, 1 })] public static byte[] Invoke<a>(bool isLittleEndian, a value) { throw new NotSupportedException("Dynamic invocation of ToBytes is not supported"); } [CompilationArgumentCounts(new int[] { 1, 1 })] public static byte[] Invoke$W<a>(FSharpFunc<a, FSharpFunc<bool, FSharpFunc<ToBytes, byte[]>>> toBytes, bool isLittleEndian, a value) { return FSharpFunc<FSharpPlus.Control.ToBytes, bool>.InvokeFast<ToBytes, byte[]>((FSharpFunc<ToBytes, FSharpFunc<bool, FSharpFunc<ToBytes, byte[]>>>)(object)toBytes, (ToBytes)value, isLittleEndian, (ToBytes)null); } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class TryParse : Default1 { public static FSharpFunc<string, FSharpOption<decimal>> TryParse(decimal _arg1, TryParse _arg2) { return $Converter.TryParse@90.@_instance; } public static FSharpFunc<string, FSharpOption<float>> TryParse(float _arg3, TryParse _arg4) { return $Converter.TryParse@91-1.@_instance; } public static FSharpFunc<string, FSharpOption<double>> TryParse(double _arg5, TryParse _arg6) { return $Converter.TryParse@92-2.@_instance; } public static FSharpFunc<string, FSharpOption<ushort>> TryParse(ushort _arg7, TryParse _arg8) { return $Converter.TryParse@93-3.@_instance; } public static FSharpFunc<string, FSharpOption<uint>> TryParse(uint _arg9, TryParse _arg10) { return $Converter.TryParse@94-4.@_instance; } public static FSharpFunc<string, FSharpOption<ulong>> TryParse(ulong _arg11, TryParse _arg12) { return $Converter.TryParse@95-5.@_instance; } public static FSharpFunc<string, FSharpOption<short>> TryParse(short _arg13, TryParse _arg14) { return $Converter.TryParse@96-6.@_instance; } public static FSharpFunc<string, FSharpOption<int>> TryParse(int _arg15, TryParse _arg16) { return $Converter.TryParse@97-7.@_instance; } public static FSharpFunc<string, FSharpOption<long>> TryParse(long _arg17, TryParse _arg18) { return $Converter.TryParse@98-8.@_instance; } public static FSharpFunc<string, FSharpOption<string>> TryParse(string _arg19, TryParse _arg20) { return $Converter.TryParse@111-9.@_instance; } public static FSharpFunc<string, FSharpOption<StringBuilder>> TryParse(StringBuilder _arg21, TryParse _arg22) { return $Converter.TryParse@112-10.@_instance; } public static FSharpFunc<string, FSharpOption<DateTime>> TryParse(DateTime _arg23, TryParse _arg24) { return $Converter.TryParse@115-11.@_instance; } public static FSharpFunc<string, FSharpOption<DateTimeOffset>> TryParse(DateTimeOffset _arg25, TryParse _arg26) { return $Converter.TryParse@123-12.@_instance; } public static FSharpOption<b> Invoke<b>(string value) { TryParse item = null; return FSharpFunc<Tuple<FSharpPlus.Control.TryParse, FSharpOption<b>>, string>.InvokeFast<FSharpOption<b>>((FSharpFunc<Tuple<TryParse, FSharpOption<b>>, FSharpFunc<string, FSharpOption<b>>>)(object)$Converter.Invoke@135-4<b>.@_instance, (Tuple<TryParse, FSharpOption<b>>)(object)new Tuple<TryParse, b>(item, default(b)), value); } public static FSharpOption<b> Invoke$W<b>(FSharpFunc<b, FSharpFunc<TryParse, FSharpFunc<string, FSharpOption<b>>>> tryParse, string value) { TryParse item = null; return FSharpFunc<Tuple<FSharpPlus.Control.TryParse, FSharpOption<b>>, string>.InvokeFast<FSharpOption<b>>((FSharpFunc<Tuple<TryParse, FSharpOption<b>>, FSharpFunc<string, FSharpOption<b>>>)(object)new $Converter.Invoke@135-5<b>(tryParse), (Tuple<TryParse, FSharpOption<b>>)(object)new Tuple<TryParse, b>(item, default(b)), value); } public static FSharpOption<R> InvokeOnInstance<R>(string value) { throw new NotSupportedException("Dynamic invocation of TryParse is not supported"); } public static FSharpOption<R> InvokeOnInstance$W<R>(FSharpFunc<string, FSharpOption<R>> tryParse, string value) { return tryParse.Invoke(value); } public static FSharpOption<R> InvokeOnConvention<R, a>(string value) { R val = default(R); if (0 == 0) { throw new NotSupportedException("Dynamic invocation of TryParse is not supported"); } if ((bool)(object)null) { return FSharpOption<R>.Some(val); } return null; } public unsafe static FSharpOption<R> InvokeOnConvention$W<R, a>(FSharpFunc<string, FSharpFunc<ref R, bool>> tryParse, string value) { R val = default(R); if (FSharpFunc<string, ref bool>.InvokeFast<bool>((FSharpFunc<string, FSharpFunc<ref bool, bool>>)(object)tryParse, value, ref *(bool*)(&val))) { return FSharpOption<R>.Some(val); } return null; } public static FSharpFunc<string, FSharpOption<R>> TryParse<R>(R _arg1, Default4 _arg2) { return $Converter.TryParse@211-13<R>.@_instance; } public static FSharpFunc<string, FSharpOption<R>> TryParse$W<R>(FSharpFunc<string, R> parse, R _arg1, Default4 _arg2) { return new $Converter.TryParse@211-14<R>(parse); } public static FSharpFunc<string, FSharpOption<R>> TryParse<R, a>(R _arg3, Default3 _arg4) { return $Converter.TryParse@216-15<R, a>.@_instance; } public static FSharpFunc<string, FSharpOption<R>> TryParse$W<R, a>(FSharpFunc<string, FSharpFunc<ref R, bool>> tryParse, R _arg3, Default3 _arg4) { return new $Converter.TryParse@216-16<R, a>(tryParse); } public static FSharpFunc<string, FSharpOption<R>> TryParse<R>(R _arg5, Default2 _arg6) { return $Converter.TryParse@218-17<R>.@_instance; } public static FSharpFunc<string, FSharpOption<R>> TryParse$W<R>(FSharpFunc<string, FSharpOption<R>> tryParse, R _arg5, Default2 _arg6) { return new $Converter.TryParse@218-18<R>(tryParse); } public static FSharpFunc<a, a> TryParse<t, a>(t _arg7, Default2 _arg8) where t : class { return $Converter.TryParse@224-19<a>.@_instance; } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class Parse : Default1 { public static FSharpFunc<string, R> Parse<R>(R _arg1, Parse _arg2) { return $Converter.Parse@155<R>.@_instance; } public static FSharpFunc<string, R> Parse$W<R>(FSharpFunc<string, FSharpFunc<CultureInfo, R>> parse, R _arg1, Parse _arg2) { return new $Converter.Parse@155-1<R>(parse); } public static FSharpFunc<string, @enum> Parse<T, a, @enum>(T _arg3, Parse _arg4) where @enum : struct { return $Converter.Parse@157-2<@enum>.@_instance; } public static FSharpFunc<string, DateTime> Parse(DateTime _arg5, Parse _arg6) { return $Converter.Parse@164-3.@_instance; } public static FSharpFunc<string, DateTimeOffset> Parse(DateTimeOffset _arg7, Parse _arg8) { return $Converter.Parse@169-4.@_instance; } public static FSharpFunc<string, bool> Parse(bool _arg9, Parse _arg10) { return $Converter.Parse@174-5.@_instance; } public static FSharpFunc<string, char> Parse(char _arg11, Parse _arg12) { return $Converter.Parse@176-6.@_instance; } public static FSharpFunc<string, string> Parse(string _arg13, Parse _arg14) { return $Converter.Parse@177-7.@_instance; } public static FSharpFunc<string, StringBuilder> Parse(StringBuilder _arg15, Parse _arg16) { return $Converter.Parse@178-8.@_instance; } public static a Invoke<a>(string value) { Parse item = null; return FSharpFunc<Tuple<FSharpPlus.Control.Parse, a>, string>.InvokeFast<a>((FSharpFunc<Tuple<Parse, a>, FSharpFunc<string, a>>)$Converter.Invoke@183-6<a>.@_instance, new Tuple<Parse, a>(item, default(a)), value); } public static a Invoke$W<a>(FSharpFunc<a, FSharpFunc<Parse, FSharpFunc<string, a>>> parse, string value) { Parse item = null; return FSharpFunc<Tuple<FSharpPlus.Control.Parse, a>, string>.InvokeFast<a>((FSharpFunc<Tuple<Parse, a>, FSharpFunc<string, a>>)new $Converter.Invoke@183-7<a>(parse), new Tuple<Parse, a>(item, default(a)), value); } public static R InvokeOnInstance<R>(string value) { throw new NotSupportedException("Dynamic invocation of Parse is not supported"); } public static R InvokeOnInstance$W<R>(FSharpFunc<string, R> parse, string value) { return parse.Invoke(value); } public static FSharpFunc<string, R> Parse<R, a>(R _arg1, Default4 _arg2) { return $Converter.Parse@190-9<R, a>.@_instance; } public static FSharpFunc<string, R> Parse$W<R, a>(FSharpFunc<string, FSharpFunc<ref R, bool>> tryParse, R _arg1, Default4 _arg2) { return new $Converter.Parse@190-10<R, a>(tryParse); } public static FSharpFunc<string, R> Parse<R>(R _arg3, Default3 _arg4) { return $Converter.Parse@195-11<R>.@_instance; } public static FSharpFunc<string, R> Parse$W<R>(FSharpFunc<string, FSharpOption<R>> tryParse, R _arg3, Default3 _arg4) { return new $Converter.Parse@195-12<R>(tryParse); } public static FSharpFunc<string, R> Parse<R>(R _arg5, Default2 _arg6) { return $Converter.Parse@200-13<R>.@_instance; } public static FSharpFunc<string, R> Parse$W<R>(FSharpFunc<string, R> parse, R _arg5, Default2 _arg6) { return new $Converter.Parse@200-14<R>(parse); } public static FSharpFunc<a, a> Parse<t, a>(t _arg7, Default2 _arg8) where t : class { return $Converter.Parse@206-15<a>.@_instance; } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class FromBigInt : Default1 { public static FSharpFunc<System.Numerics.BigInteger, R> FromBigInt<R>(R _arg1, Default4 _arg2) { return $Numeric.FromBigInt@19<R>.@_instance; } public static FSharpFunc<System.Numerics.BigInteger, R> FromBigInt$W<R>(FSharpFunc<R, FSharpFunc<Explicit, FSharpFunc<System.Numerics.BigInteger, R>>> @explicit, R _arg1, Default4 _arg2) { return new $Numeric.FromBigInt@19-2<R>(@explicit); } public static FSharpFunc<System.Numerics.BigInteger, R> FromBigInt<R>(R _arg3, Default3 _arg4) { return $Numeric.FromBigInt@20-4<R>.@_instance; } public static FSharpFunc<System.Numerics.BigInteger, R> FromBigInt$W<R>(FSharpFunc<long, R> op_Implicit, R _arg3, Default3 _arg4) { return new $Numeric.FromBigInt@20-5<R>(op_Implicit); } public static FSharpFunc<System.Numerics.BigInteger, R> FromBigInt<R>(R _arg5, Default2 _arg6) { return $Numeric.FromBigInt@21-6<R>.@_instance; } public static FSharpFunc<System.Numerics.BigInteger, R> FromBigInt$W<R>(FSharpFunc<System.Numerics.BigInteger, R> op_Implicit, R _arg5, Default2 _arg6) { return new $Numeric.FromBigInt@21-7<R>(op_Implicit); } public static FSharpFunc<System.Numerics.BigInteger, R> FromBigInt<R>(R _arg7, Default1 _arg8) { return $Numeric.FromBigInt@22-8<R>.@_instance; } public static FSharpFunc<System.Numerics.BigInteger, R> FromBigInt$W<R>(FSharpFunc<System.Numerics.BigInteger, R> fromBigInt, R _arg7, Default1 _arg8) { return new $Numeric.FromBigInt@22-9<R>(fromBigInt); } public static FSharpFunc<System.Numerics.BigInteger, R> FromBigInt<R>(Default1 _arg9, Default1 _arg10) { return $Numeric.FromBigInt@23-10<R>.@_instance; } public static FSharpFunc<System.Numerics.BigInteger, R> FromBigInt$W<R>(FSharpFunc<System.Numerics.BigInteger, R> fromBigInt, Default1 _arg9, Default1 _arg10) { return new $Numeric.FromBigInt@23-11<R>(fromBigInt); } public static FSharpFunc<System.Numerics.BigInteger, int> FromBigInt(int _arg11, FromBigInt _arg12) { return $Numeric.FromBigInt@24-12.@_instance; } public static FSharpFunc<System.Numerics.BigInteger, long> FromBigInt(long _arg13, FromBigInt _arg14) { return $Numeric.FromBigInt@25-13.@_instance; } public static FSharpFunc<System.Numerics.BigInteger, IntPtr> FromBigInt(IntPtr _arg15, FromBigInt _arg16) { return $Numeric.FromBigInt@26-14.@_instance; } public static FSharpFunc<System.Numerics.BigInteger, UIntPtr> FromBigInt(UIntPtr _arg17, FromBigInt _arg18) { return $Numeric.FromBigInt@27-15.@_instance; } public static FSharpFunc<System.Numerics.BigInteger, System.Numerics.BigInteger> FromBigInt(System.Numerics.BigInteger _arg19, FromBigInt _arg20) { return $Numeric.FromBigInt@28-16.@_instance; } public static FSharpFunc<System.Numerics.BigInteger, double> FromBigInt(double _arg21, FromBigInt _arg22) { return $Numeric.FromBigInt@29-17.@_instance; } public static FSharpFunc<System.Numerics.BigInteger, sbyte> FromBigInt(sbyte _arg23, FromBigInt _arg24) { return $Numeric.FromBigInt@30-18.@_instance; } public static FSharpFunc<System.Numerics.BigInteger, short> FromBigInt(short _arg25, FromBigInt _arg26) { return $Numeric.FromBigInt@31-19.@_instance; } public static FSharpFunc<System.Numerics.BigInteger, byte> FromBigInt(byte _arg27, FromBigInt _arg28) { return $Numeric.FromBigInt@32-20.@_instance; } public static FSharpFunc<System.Numerics.BigInteger, ushort> FromBigInt(ushort _arg29, FromBigInt _arg30) { return $Numeric.FromBigInt@33-21.@_instance; } public static FSharpFunc<System.Numerics.BigInteger, uint> FromBigInt(uint _arg31, FromBigInt _arg32) { return $Numeric.FromBigInt@34-22.@_instance; } public static FSharpFunc<System.Numerics.BigInteger, ulong> FromBigInt(ulong _arg33, FromBigInt _arg34) { return $Numeric.FromBigInt@35-23.@_instance; } public static FSharpFunc<System.Numerics.BigInteger, float> FromBigInt(float _arg35, FromBigInt _arg36) { return $Numeric.FromBigInt@36-24.@_instance; } public static FSharpFunc<System.Numerics.BigInteger, decimal> FromBigInt(decimal _arg37, FromBigInt _arg38) { return $Numeric.FromBigInt@37-25.@_instance; } public static Num Invoke<Num>(System.Numerics.BigInteger x) { FromBigInt item = null; return FSharpFunc<Tuple<FSharpPlus.Control.FromBigInt, Num>, System.Numerics.BigInteger>.InvokeFast<Num>((FSharpFunc<Tuple<FromBigInt, Num>, FSharpFunc<System.Numerics.BigInteger, Num>>)$Numeric.Invoke@42-8<Num>.@_instance, new Tuple<FromBigInt, Num>(item, default(Num)), x); } public static Num Invoke$W<Num>(FSharpFunc<Num, FSharpFunc<FromBigInt, FSharpFunc<System.Numerics.BigInteger, Num>>> fromBigInt, System.Numerics.BigInteger x) { FromBigInt item = null; return FSharpFunc<Tuple<FSharpPlus.Control.FromBigInt, Num>, System.Numerics.BigInteger>.InvokeFast<Num>((FSharpFunc<Tuple<FromBigInt, Num>, FSharpFunc<System.Numerics.BigInteger, Num>>)new $Numeric.Invoke@42-9<Num>(fromBigInt), new Tuple<FromBigInt, Num>(item, default(Num)), x); } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class FromInt64 : Default1 { public static FSharpFunc<long, R> FromInt64<R>(R _arg1, Default4 _arg2) { return $Numeric.FromInt64@49<R>.@_instance; } public static FSharpFunc<long, R> FromInt64$W<R>(FSharpFunc<R, FSharpFunc<Explicit, FSharpFunc<long, R>>> @explicit, R _arg1, Default4 _arg2) { return new $Numeric.FromInt64@49-2<R>(@explicit); } public static FSharpFunc<long, R> FromInt64<R>(R _arg3, Default3 _arg4) { return $Numeric.FromInt64@51-4<R>.@_instance; } public static FSharpFunc<long, R> FromInt64$W<R>(FSharpFunc<R, FSharpFunc<FromBigInt, FSharpFunc<System.Numerics.BigInteger, R>>> fromBigInt, R _arg3, Default3 _arg4) { return new $Numeric.FromInt64@51-6<R>(fromBigInt); } public static FSharpFunc<long, R> FromInt64<R>(R _arg5, Default2 _arg6) { return $Numeric.FromInt64@53-8<R>.@_instance; } public static FSharpFunc<long, R> FromInt64$W<R>(FSharpFunc<long, R> op_Implicit, R _arg5, Default2 _arg6) { return new $Numeric.FromInt64@53-9<R>(op_Implicit); } public static FSharpFunc<long, R> FromInt64<R>(R _arg7, Default1 _arg8) { return $Numeric.FromInt64@54-10<R>.@_instance; } public static FSharpFunc<long, R> FromInt64$W<R>(FSharpFunc<long, R> fromInt64, R _arg7, Default1 _arg8) { return new $Numeric.FromInt64@54-11<R>(fromInt64); } public static FSharpFunc<long, R> FromInt64<R>(Default1 _arg9, Default1 _arg10) { return $Numeric.FromInt64@55-12<R>.@_instance; } public static FSharpFunc<long, R> FromInt64$W<R>(FSharpFunc<long, R> fromInt64, Default1 _arg9, Default1 _arg10) { return new $Numeric.FromInt64@55-13<R>(fromInt64); } public static FSharpFunc<long, int> FromInt64(int _arg11, FromInt64 _arg12) { return $Numeric.FromInt64@56-14.@_instance; } public static FSharpFunc<long, long> FromInt64(long _arg13, FromInt64 _arg14) { return $Numeric.FromInt64@57-15.@_instance; } public static FSharpFunc<long, IntPtr> FromInt64(IntPtr _arg15, FromInt64 _arg16) { return $Numeric.FromInt64@59-16.@_instance; } public static FSharpFunc<long, UIntPtr> FromInt64(UIntPtr _arg17, FromInt64 _arg18) { return $Numeric.FromInt64@60-17.@_instance; } public static FSharpFunc<long, System.Numerics.BigInteger> FromInt64(System.Numerics.BigInteger _arg19, FromInt64 _arg20) { return $Numeric.FromInt64@61-18.@_instance; } public static FSharpFunc<long, double> FromInt64(double _arg21, FromInt64 _arg22) { return $Numeric.FromInt64@63-19.@_instance; } public static FSharpFunc<long, float> FromInt64(float _arg23, FromInt64 _arg24) { return $Numeric.FromInt64@64-20.@_instance; } public static FSharpFunc<long, decimal> FromInt64(decimal _arg25, FromInt64 _arg26) { return $Numeric.FromInt64@65-21.@_instance; } public static FSharpFunc<long, sbyte> FromInt64(sbyte _arg27, FromInt64 _arg28) { return $Numeric.FromInt64@66-22.@_instance; } public static FSharpFunc<long, short> FromInt64(short _arg29, FromInt64 _arg30) { return $Numeric.FromInt64@67-23.@_instance; } public static FSharpFunc<long, byte> FromInt64(byte _arg31, FromInt64 _arg32) { return $Numeric.FromInt64@68-24.@_instance; } public static FSharpFunc<long, ushort> FromInt64(ushort _arg33, FromInt64 _arg34) { return $Numeric.FromInt64@69-25.@_instance; } public static FSharpFunc<long, uint> FromInt64(uint _arg35, FromInt64 _arg36) { return $Numeric.FromInt64@70-26.@_instance; } public static FSharpFunc<long, ulong> FromInt64(ulong _arg37, FromInt64 _arg38) { return $Numeric.FromInt64@71-27.@_instance; } public static Num Invoke<Num>(long x) { FromInt64 item = null; return FSharpFunc<Tuple<FSharpPlus.Control.FromInt64, Num>, long>.InvokeFast<Num>((FSharpFunc<Tuple<FromInt64, Num>, FSharpFunc<long, Num>>)$Numeric.Invoke@76-10<Num>.@_instance, new Tuple<FromInt64, Num>(item, default(Num)), x); } public static Num Invoke$W<Num>(FSharpFunc<Num, FSharpFunc<FromInt64, FSharpFunc<long, Num>>> fromInt64, long x) { FromInt64 item = null; return FSharpFunc<Tuple<FSharpPlus.Control.FromInt64, Num>, long>.InvokeFast<Num>((FSharpFunc<Tuple<FromInt64, Num>, FSharpFunc<long, Num>>)new $Numeric.Invoke@76-11<Num>(fromInt64), new Tuple<FromInt64, Num>(item, default(Num)), x); } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class FromInt32 : Default1 { public static FSharpFunc<int, R> FromInt32<R>(R _arg1, Default4 _arg2) { return $Numeric.FromInt32@81<R>.@_instance; } public static FSharpFunc<int, R> FromInt32$W<R>(FSharpFunc<R, FSharpFunc<Explicit, FSharpFunc<int, R>>> @explicit, R _arg1, Default4 _arg2) { return new $Numeric.FromInt32@81-2<R>(@explicit); } public static FSharpFunc<int, R> FromInt32<R>(R _arg3, Default3 _arg4) { return $Numeric.FromInt32@82-4<R>.@_instance; } public static FSharpFunc<int, R> FromInt32$W<R>(FSharpFunc<R, FSharpFunc<FromInt64, FSharpFunc<long, R>>> fromInt64, R _arg3, Default3 _arg4) { return new $Numeric.FromInt32@82-6<R>(fromInt64); } public static FSharpFunc<int, R> FromInt32<R>(R _arg5, Default2 _arg6) { return $Numeric.FromInt32@83-8<R>.@_instance; } public static FSharpFunc<int, R> FromInt32$W<R>(FSharpFunc<int, R> op_Implicit, R _arg5, Default2 _arg6) { return new $Numeric.FromInt32@83-9<R>(op_Implicit); } public static FSharpFunc<int, R> FromInt32<R>(R _arg7, Default1 _arg8) { return $Numeric.FromInt32@84-10<R>.@_instance; } public static FSharpFunc<int, R> FromInt32$W<R>(FSharpFunc<int, R> fromInt32, R _arg7, Default1 _arg8) { return new $Numeric.FromInt32@84-11<R>(fromInt32); } public static FSharpFunc<int, R> FromInt32<R>(Default1 _arg9, Default1 _arg10) { return $Numeric.FromInt32@85-12<R>.@_instance; } public static FSharpFunc<int, R> FromInt32$W<R>(FSharpFunc<int, R> fromInt32, Default1 _arg9, Default1 _arg10) { return new $Numeric.FromInt32@85-13<R>(fromInt32); } public static FSharpFunc<int, int> FromInt32(int _arg11, FromInt32 _arg12) { return $Numeric.FromInt32@86-14.@_instance; } public static FSharpFunc<int, long> FromInt32(long _arg13, FromInt32 _arg14) { return $Numeric.FromInt32@87-15.@_instance; } public static FSharpFunc<int, IntPtr> FromInt32(IntPtr _arg15, FromInt32 _arg16) { return $Numeric.FromInt32@89-16.@_instance; } public static FSharpFunc<int, UIntPtr> FromInt32(UIntPtr _arg17, FromInt32 _arg18) { return $Numeric.FromInt32@90-17.@_instance; } public static FSharpFunc<int, System.Numerics.BigInteger> FromInt32(System.Numerics.BigInteger _arg19, FromInt32 _arg20) { return $Numeric.FromInt32@91-18.@_instance; } public static FSharpFunc<int, double> FromInt32(double _arg21, FromInt32 _arg22) { return $Numeric.FromInt32@93-19.@_instance; } public static FSharpFunc<int, sbyte> FromInt32(sbyte _arg23, FromInt32 _arg24) { return $Numeric.FromInt32@94-20.@_instance; } public static FSharpFunc<int, short> FromInt32(short _arg25, FromInt32 _arg26) { return $Numeric.FromInt32@95-21.@_instance; } public static FSharpFunc<int, byte> FromInt32(byte _arg27, FromInt32 _arg28) { return $Numeric.FromInt32@96-22.@_instance; } public static FSharpFunc<int, ushort> FromInt32(ushort _arg29, FromInt32 _arg30) { return $Numeric.FromInt32@97-23.@_instance; } public static FSharpFunc<int, uint> FromInt32(uint _arg31, FromInt32 _arg32) { return $Numeric.FromInt32@98-24.@_instance; } public static FSharpFunc<int, ulong> FromInt32(ulong _arg33, FromInt32 _arg34) { return $Numeric.FromInt32@99-25.@_instance; } public static FSharpFunc<int, float> FromInt32(float _arg35, FromInt32 _arg36) { return $Numeric.FromInt32@100-26.@_instance; } public static FSharpFunc<int, decimal> FromInt32(decimal _arg37, FromInt32 _arg38) { return $Numeric.FromInt32@101-27.@_instance; } public static Num Invoke<Num>(int x) { FromInt32 item = null; return FSharpFunc<Tuple<FSharpPlus.Control.FromInt32, Num>, int>.InvokeFast<Num>((FSharpFunc<Tuple<FromInt32, Num>, FSharpFunc<int, Num>>)$Numeric.Invoke@106-12<Num>.@_instance, new Tuple<FromInt32, Num>(item, default(Num)), x); } public static Num Invoke$W<Num>(FSharpFunc<Num, FSharpFunc<FromInt32, FSharpFunc<int, Num>>> fromInt32, int x) { FromInt32 item = null; return FSharpFunc<Tuple<FSharpPlus.Control.FromInt32, Num>, int>.InvokeFast<Num>((FSharpFunc<Tuple<FromInt32, Num>, FSharpFunc<int, Num>>)new $Numeric.Invoke@106-13<Num>(fromInt32), new Tuple<FromInt32, Num>(item, default(Num)), x); } public static Num InvokeOnInstance<Num>(int x) { throw new NotSupportedException("Dynamic invocation of FromInt32 is not supported"); } public static Num InvokeOnInstance$W<Num>(FSharpFunc<int, Num> fromInt32, int x) { return fromInt32.Invoke(x); } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class One : Default1 { public static t One<t>(t _arg1, Default1 _arg2) { FromInt32 item = null; return FSharpFunc<Tuple<FromInt32, t>, int>.InvokeFast<t>((FSharpFunc<Tuple<FromInt32, t>, FSharpFunc<int, t>>)$Numeric.One@115<t>.@_instance, new Tuple<FromInt32, t>(item, default(t)), 1); } public static t One$W<t>(FSharpFunc<t, FSharpFunc<FromInt32, FSharpFunc<int, t>>> fromInt32, t _arg1, Default1 _arg2) { FromInt32 item = null; return FSharpFunc<Tuple<FromInt32, t>, int>.InvokeFast<t>((FSharpFunc<Tuple<FromInt32, t>, FSharpFunc<int, t>>)new $Numeric.One@115-1<t>(fromInt32), new Tuple<FromInt32, t>(item, default(t)), 1); } public static t One<t>(t _arg3, One _arg4) { return LanguagePrimitives.GenericOneDynamic<t>(); } public static t One$W<t>(FSharpFunc<Unit, t> get_One, t _arg3, One _arg4) { return get_One.Invoke((Unit)null); } public static FSharpFunc<a, a> One<t, a>(t _arg5, One _arg6) where t : class { return $Numeric.One@117-2<a>.@_instance; } public static Num Invoke<Num>() { One one = null; throw new NotSupportedException("Dynamic invocation of One is not supported"); } public static Num Invoke$W<Num>(FSharpFunc<Num, FSharpFunc<One, Num>> one) { One one2 = null; return FSharpFunc<Num, FSharpPlus.Control.One>.InvokeFast<Num>(one, default(Num), one2); } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class Zero : Default1 { public static TimeSpan Zero(TimeSpan _arg1, Zero _arg2) { return default(TimeSpan); } public static DmStruct Zero(DmStruct _arg3, Zero _arg4) { return default(DmStruct); } public static FSharpList<a> Zero<a>(FSharpList<a> _arg5, Zero _arg6) { return FSharpList<a>.Empty; } public static FSharpOption<a> Zero<a>(FSharpOption<a> _arg7, Zero _arg8) { return null; } public static FSharpValueOption<a> Zero<a>(FSharpValueOption<a> _arg9, Zero _arg10) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return FSharpValueOption<a>.ValueNone; } public static a[] Zero<a>(a[] _arg11, Zero _arg12) { return System.Array.Empty<a>(); } public static string Zero(string _arg13, Zero _arg14) { return ""; } public static StringBuilder Zero(StringBuilder _arg15, Zero _arg16) { return new StringBuilder(); } public static void Zero(Unit _arg17, Zero _arg18) { } public static bool Zero(bool _arg19, Zero _arg20) { return false; } public static FSharpSet<a> Zero<a>(FSharpSet<a> _arg21, Zero _arg22) { return SetModule.Empty<a>(); } public static FSharpMap<a, b> Zero<a, b>(FSharpMap<a, b> _arg23, Zero _arg24) { return MapModule.Empty<a, b>(); } public static a Invoke<a>() { Zero zero = null; throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } public static a Invoke$W<a>(FSharpFunc<a, FSharpFunc<Zero, a>> zero) { Zero zero2 = null; return FSharpFunc<a, FSharpPlus.Control.Zero>.InvokeFast<a>(zero, default(a), zero2); } public static t Zero<t, t1, t2, t3, t4, t5, t6, t7, tr>(t t, Zero _arg1) { Zero zero = null; if (0 == 0) { throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } tr rest = (tr)(object)null; zero = null; if (0 == 0) { throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } t7 item = (t7)(object)null; zero = null; if (0 == 0) { throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } t6 item2 = (t6)(object)null; zero = null; if (0 == 0) { throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } t5 item3 = (t5)(object)null; zero = null; if (0 == 0) { throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } t4 item4 = (t4)(object)null; zero = null; if (0 == 0) { throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } t3 item5 = (t3)(object)null; zero = null; if (0 == 0) { throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } t2 item6 = (t2)(object)null; zero = null; if (0 == 0) { throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } t1 item7 = (t1)(object)null; return (t)new Tuple<t1, t2, t3, t4, t5, t6, t7, tr>(item7, item6, item5, item4, item3, item2, item, rest); } public static t Zero$W<t, t1, t2, t3, t4, t5, t6, t7, tr>(FSharpFunc<t1, FSharpFunc<Zero, t1>> zero, FSharpFunc<t2, FSharpFunc<Zero, t2>> zero1, FSharpFunc<t3, FSharpFunc<Zero, t3>> zero2, FSharpFunc<t4, FSharpFunc<Zero, t4>> zero3, FSharpFunc<t5, FSharpFunc<Zero, t5>> zero4, FSharpFunc<t6, FSharpFunc<Zero, t6>> zero5, FSharpFunc<t7, FSharpFunc<Zero, t7>> zero6, FSharpFunc<tr, FSharpFunc<Zero, tr>> zero7, FSharpFunc<t, t1> get_Item1, FSharpFunc<t, t2> get_Item2, FSharpFunc<t, t3> get_Item3, FSharpFunc<t, t4> get_Item4, FSharpFunc<t, t5> get_Item5, FSharpFunc<t, t6> get_Item6, FSharpFunc<t, t7> get_Item7, FSharpFunc<t, tr> get_Rest, t t, Zero _arg1) { Zero zero8 = null; tr rest = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<tr>((FSharpFunc<?, FSharpFunc<Zero, tr>>)(object)zero7, default(tr), zero8); zero8 = null; t7 item = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<t7>((FSharpFunc<?, FSharpFunc<Zero, t7>>)(object)zero6, default(t7), zero8); zero8 = null; t6 item2 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<t6>((FSharpFunc<?, FSharpFunc<Zero, t6>>)(object)zero5, default(t6), zero8); zero8 = null; t5 item3 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<t5>((FSharpFunc<?, FSharpFunc<Zero, t5>>)(object)zero4, default(t5), zero8); zero8 = null; t4 item4 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<t4>((FSharpFunc<?, FSharpFunc<Zero, t4>>)(object)zero3, default(t4), zero8); zero8 = null; t3 item5 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<t3>((FSharpFunc<?, FSharpFunc<Zero, t3>>)(object)zero2, default(t3), zero8); zero8 = null; t2 item6 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<t2>((FSharpFunc<?, FSharpFunc<Zero, t2>>)(object)zero1, default(t2), zero8); zero8 = null; t1 item7 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<t1>((FSharpFunc<?, FSharpFunc<Zero, t1>>)(object)zero, default(t1), zero8); return (t)new Tuple<t1, t2, t3, t4, t5, t6, t7, tr>(item7, item6, item5, item4, item3, item2, item, rest); } public static Tuple<a> Zero<a>(Tuple<a> _arg1, Zero _arg2) { Zero zero = null; if (0 == 0) { throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } return new Tuple<a>((a)(object)null); } public static Tuple<a> Zero$W<a>(FSharpFunc<a, FSharpFunc<Zero, a>> zero, Tuple<a> _arg1, Zero _arg2) { Zero zero2 = null; return new Tuple<a>(FSharpFunc<a, FSharpPlus.Control.Zero>.InvokeFast<a>(zero, default(a), zero2)); } public static Id<a> Zero<a, a>(Id<a> _arg3, Zero _arg4) { Zero zero = null; if (0 == 0) { throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } return new Id<a>((a)(object)null); } public static Id<a> Zero$W<a, a>(FSharpFunc<a, FSharpFunc<Zero, a>> zero, Id<a> _arg3, Zero _arg4) { Zero zero2 = null; return new Id<a>(FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<a>((FSharpFunc<?, FSharpFunc<Zero, a>>)(object)zero, default(a), zero2)); } public static ValueTuple<a> Zero<a>(ValueTuple<a> _arg5, Zero _arg6) { Zero zero = null; if (0 == 0) { throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } return new ValueTuple<a>((a)(object)null); } public static ValueTuple<a> Zero$W<a>(FSharpFunc<a, FSharpFunc<Zero, a>> zero, ValueTuple<a> _arg5, Zero _arg6) { Zero zero2 = null; return new ValueTuple<a>(FSharpFunc<a, FSharpPlus.Control.Zero>.InvokeFast<a>(zero, default(a), zero2)); } public static Tuple<a, b> Zero<a, b>(Tuple<a, b> _arg1, Zero _arg2) { Zero zero = null; if (false) { a item = (a)(object)null; zero = null; if (0 == 0) { throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } return new Tuple<a, b>(item, (b)(object)null); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } public static Tuple<a, b> Zero$W<a, b>(FSharpFunc<a, FSharpFunc<Zero, a>> zero, FSharpFunc<b, FSharpFunc<Zero, b>> zero1, Tuple<a, b> _arg1, Zero _arg2) { Zero zero2 = null; a item = FSharpFunc<a, FSharpPlus.Control.Zero>.InvokeFast<a>(zero, default(a), zero2); zero2 = null; return new Tuple<a, b>(item, FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<b>((FSharpFunc<?, FSharpFunc<Zero, b>>)(object)zero1, default(b), zero2)); } public static Tuple<a, b, c> Zero<a, b, c>(Tuple<a, b, c> _arg1, Zero _arg2) { Zero zero = null; if (false) { a item = (a)(object)null; zero = null; if (false) { b item2 = (b)(object)null; zero = null; if (0 == 0) { throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } return new Tuple<a, b, c>(item, item2, (c)(object)null); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } public static Tuple<a, b, c> Zero$W<a, b, c>(FSharpFunc<a, FSharpFunc<Zero, a>> zero, FSharpFunc<b, FSharpFunc<Zero, b>> zero1, FSharpFunc<c, FSharpFunc<Zero, c>> zero2, Tuple<a, b, c> _arg1, Zero _arg2) { Zero zero3 = null; a item = FSharpFunc<a, FSharpPlus.Control.Zero>.InvokeFast<a>(zero, default(a), zero3); zero3 = null; b item2 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<b>((FSharpFunc<?, FSharpFunc<Zero, b>>)(object)zero1, default(b), zero3); zero3 = null; return new Tuple<a, b, c>(item, item2, FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<c>((FSharpFunc<?, FSharpFunc<Zero, c>>)(object)zero2, default(c), zero3)); } public static Tuple<a, b, c, d> Zero<a, b, c, d>(Tuple<a, b, c, d> _arg1, Zero _arg2) { Zero zero = null; if (false) { a item = (a)(object)null; zero = null; if (false) { b item2 = (b)(object)null; zero = null; if (false) { c item3 = (c)(object)null; zero = null; if (0 == 0) { throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } return new Tuple<a, b, c, d>(item, item2, item3, (d)(object)null); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } public static Tuple<a, b, c, d> Zero$W<a, b, c, d>(FSharpFunc<a, FSharpFunc<Zero, a>> zero, FSharpFunc<b, FSharpFunc<Zero, b>> zero1, FSharpFunc<c, FSharpFunc<Zero, c>> zero2, FSharpFunc<d, FSharpFunc<Zero, d>> zero3, Tuple<a, b, c, d> _arg1, Zero _arg2) { Zero zero4 = null; a item = FSharpFunc<a, FSharpPlus.Control.Zero>.InvokeFast<a>(zero, default(a), zero4); zero4 = null; b item2 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<b>((FSharpFunc<?, FSharpFunc<Zero, b>>)(object)zero1, default(b), zero4); zero4 = null; c item3 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<c>((FSharpFunc<?, FSharpFunc<Zero, c>>)(object)zero2, default(c), zero4); zero4 = null; return new Tuple<a, b, c, d>(item, item2, item3, FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<d>((FSharpFunc<?, FSharpFunc<Zero, d>>)(object)zero3, default(d), zero4)); } public static Tuple<a, b, c, d, e> Zero<a, b, c, d, e>(Tuple<a, b, c, d, e> _arg1, Zero _arg2) { Zero zero = null; if (false) { a item = (a)(object)null; zero = null; if (false) { b item2 = (b)(object)null; zero = null; if (false) { c item3 = (c)(object)null; zero = null; if (false) { d item4 = (d)(object)null; zero = null; if (0 == 0) { throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } return new Tuple<a, b, c, d, e>(item, item2, item3, item4, (e)(object)null); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } public static Tuple<a, b, c, d, e> Zero$W<a, b, c, d, e>(FSharpFunc<a, FSharpFunc<Zero, a>> zero, FSharpFunc<b, FSharpFunc<Zero, b>> zero1, FSharpFunc<c, FSharpFunc<Zero, c>> zero2, FSharpFunc<d, FSharpFunc<Zero, d>> zero3, FSharpFunc<e, FSharpFunc<Zero, e>> zero4, Tuple<a, b, c, d, e> _arg1, Zero _arg2) { Zero zero5 = null; a item = FSharpFunc<a, FSharpPlus.Control.Zero>.InvokeFast<a>(zero, default(a), zero5); zero5 = null; b item2 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<b>((FSharpFunc<?, FSharpFunc<Zero, b>>)(object)zero1, default(b), zero5); zero5 = null; c item3 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<c>((FSharpFunc<?, FSharpFunc<Zero, c>>)(object)zero2, default(c), zero5); zero5 = null; d item4 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<d>((FSharpFunc<?, FSharpFunc<Zero, d>>)(object)zero3, default(d), zero5); zero5 = null; return new Tuple<a, b, c, d, e>(item, item2, item3, item4, FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<e>((FSharpFunc<?, FSharpFunc<Zero, e>>)(object)zero4, default(e), zero5)); } public static Tuple<a, b, c, d, e, f> Zero<a, b, c, d, e, f>(Tuple<a, b, c, d, e, f> _arg1, Zero _arg2) { Zero zero = null; if (false) { a item = (a)(object)null; zero = null; if (false) { b item2 = (b)(object)null; zero = null; if (false) { c item3 = (c)(object)null; zero = null; if (false) { d item4 = (d)(object)null; zero = null; if (false) { e item5 = (e)(object)null; zero = null; if (0 == 0) { throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } return new Tuple<a, b, c, d, e, f>(item, item2, item3, item4, item5, (f)(object)null); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } public static Tuple<a, b, c, d, e, f> Zero$W<a, b, c, d, e, f>(FSharpFunc<a, FSharpFunc<Zero, a>> zero, FSharpFunc<b, FSharpFunc<Zero, b>> zero1, FSharpFunc<c, FSharpFunc<Zero, c>> zero2, FSharpFunc<d, FSharpFunc<Zero, d>> zero3, FSharpFunc<e, FSharpFunc<Zero, e>> zero4, FSharpFunc<f, FSharpFunc<Zero, f>> zero5, Tuple<a, b, c, d, e, f> _arg1, Zero _arg2) { Zero zero6 = null; a item = FSharpFunc<a, FSharpPlus.Control.Zero>.InvokeFast<a>(zero, default(a), zero6); zero6 = null; b item2 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<b>((FSharpFunc<?, FSharpFunc<Zero, b>>)(object)zero1, default(b), zero6); zero6 = null; c item3 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<c>((FSharpFunc<?, FSharpFunc<Zero, c>>)(object)zero2, default(c), zero6); zero6 = null; d item4 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<d>((FSharpFunc<?, FSharpFunc<Zero, d>>)(object)zero3, default(d), zero6); zero6 = null; e item5 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<e>((FSharpFunc<?, FSharpFunc<Zero, e>>)(object)zero4, default(e), zero6); zero6 = null; return new Tuple<a, b, c, d, e, f>(item, item2, item3, item4, item5, FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<f>((FSharpFunc<?, FSharpFunc<Zero, f>>)(object)zero5, default(f), zero6)); } public static Tuple<a, b, c, d, e, f, g> Zero<a, b, c, d, e, f, g>(Tuple<a, b, c, d, e, f, g> _arg1, Zero _arg2) { Zero zero = null; if (false) { a item = (a)(object)null; zero = null; if (false) { b item2 = (b)(object)null; zero = null; if (false) { c item3 = (c)(object)null; zero = null; if (false) { d item4 = (d)(object)null; zero = null; if (false) { e item5 = (e)(object)null; zero = null; if (false) { f item6 = (f)(object)null; zero = null; if (0 == 0) { throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } return new Tuple<a, b, c, d, e, f, g>(item, item2, item3, item4, item5, item6, (g)(object)null); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } public static Tuple<a, b, c, d, e, f, g> Zero$W<a, b, c, d, e, f, g>(FSharpFunc<a, FSharpFunc<Zero, a>> zero, FSharpFunc<b, FSharpFunc<Zero, b>> zero1, FSharpFunc<c, FSharpFunc<Zero, c>> zero2, FSharpFunc<d, FSharpFunc<Zero, d>> zero3, FSharpFunc<e, FSharpFunc<Zero, e>> zero4, FSharpFunc<f, FSharpFunc<Zero, f>> zero5, FSharpFunc<g, FSharpFunc<Zero, g>> zero6, Tuple<a, b, c, d, e, f, g> _arg1, Zero _arg2) { Zero zero7 = null; a item = FSharpFunc<a, FSharpPlus.Control.Zero>.InvokeFast<a>(zero, default(a), zero7); zero7 = null; b item2 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<b>((FSharpFunc<?, FSharpFunc<Zero, b>>)(object)zero1, default(b), zero7); zero7 = null; c item3 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<c>((FSharpFunc<?, FSharpFunc<Zero, c>>)(object)zero2, default(c), zero7); zero7 = null; d item4 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<d>((FSharpFunc<?, FSharpFunc<Zero, d>>)(object)zero3, default(d), zero7); zero7 = null; e item5 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<e>((FSharpFunc<?, FSharpFunc<Zero, e>>)(object)zero4, default(e), zero7); zero7 = null; f item6 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<f>((FSharpFunc<?, FSharpFunc<Zero, f>>)(object)zero5, default(f), zero7); zero7 = null; return new Tuple<a, b, c, d, e, f, g>(item, item2, item3, item4, item5, item6, FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<g>((FSharpFunc<?, FSharpFunc<Zero, g>>)(object)zero6, default(g), zero7)); } public static (a, b) Zero<a, b>((a, b) _arg1, Zero _arg2) { Zero zero = null; if (false) { a item = (a)(object)null; zero = null; if (0 == 0) { throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } return ValueTuple.Create(item, (b)(object)null); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } public static (a, b) Zero$W<a, b>(FSharpFunc<a, FSharpFunc<Zero, a>> zero, FSharpFunc<b, FSharpFunc<Zero, b>> zero1, (a, b) _arg1, Zero _arg2) { Zero zero2 = null; a item = FSharpFunc<a, FSharpPlus.Control.Zero>.InvokeFast<a>(zero, default(a), zero2); zero2 = null; return ValueTuple.Create(item, FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<b>((FSharpFunc<?, FSharpFunc<Zero, b>>)(object)zero1, default(b), zero2)); } public static (a, b, c) Zero<a, b, c>((a, b, c) _arg1, Zero _arg2) { Zero zero = null; if (false) { a item = (a)(object)null; zero = null; if (false) { b item2 = (b)(object)null; zero = null; if (0 == 0) { throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } return ValueTuple.Create(item, item2, (c)(object)null); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } public static (a, b, c) Zero$W<a, b, c>(FSharpFunc<a, FSharpFunc<Zero, a>> zero, FSharpFunc<b, FSharpFunc<Zero, b>> zero1, FSharpFunc<c, FSharpFunc<Zero, c>> zero2, (a, b, c) _arg1, Zero _arg2) { Zero zero3 = null; a item = FSharpFunc<a, FSharpPlus.Control.Zero>.InvokeFast<a>(zero, default(a), zero3); zero3 = null; b item2 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<b>((FSharpFunc<?, FSharpFunc<Zero, b>>)(object)zero1, default(b), zero3); zero3 = null; return ValueTuple.Create(item, item2, FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<c>((FSharpFunc<?, FSharpFunc<Zero, c>>)(object)zero2, default(c), zero3)); } public static (a, b, c, d) Zero<a, b, c, d>((a, b, c, d) _arg1, Zero _arg2) { Zero zero = null; if (false) { a item = (a)(object)null; zero = null; if (false) { b item2 = (b)(object)null; zero = null; if (false) { c item3 = (c)(object)null; zero = null; if (0 == 0) { throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } return ValueTuple.Create(item, item2, item3, (d)(object)null); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } public static (a, b, c, d) Zero$W<a, b, c, d>(FSharpFunc<a, FSharpFunc<Zero, a>> zero, FSharpFunc<b, FSharpFunc<Zero, b>> zero1, FSharpFunc<c, FSharpFunc<Zero, c>> zero2, FSharpFunc<d, FSharpFunc<Zero, d>> zero3, (a, b, c, d) _arg1, Zero _arg2) { Zero zero4 = null; a item = FSharpFunc<a, FSharpPlus.Control.Zero>.InvokeFast<a>(zero, default(a), zero4); zero4 = null; b item2 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<b>((FSharpFunc<?, FSharpFunc<Zero, b>>)(object)zero1, default(b), zero4); zero4 = null; c item3 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<c>((FSharpFunc<?, FSharpFunc<Zero, c>>)(object)zero2, default(c), zero4); zero4 = null; return ValueTuple.Create(item, item2, item3, FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<d>((FSharpFunc<?, FSharpFunc<Zero, d>>)(object)zero3, default(d), zero4)); } public static (a, b, c, d, e) Zero<a, b, c, d, e>((a, b, c, d, e) _arg1, Zero _arg2) { Zero zero = null; if (false) { a item = (a)(object)null; zero = null; if (false) { b item2 = (b)(object)null; zero = null; if (false) { c item3 = (c)(object)null; zero = null; if (false) { d item4 = (d)(object)null; zero = null; if (0 == 0) { throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } return ValueTuple.Create(item, item2, item3, item4, (e)(object)null); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } public static (a, b, c, d, e) Zero$W<a, b, c, d, e>(FSharpFunc<a, FSharpFunc<Zero, a>> zero, FSharpFunc<b, FSharpFunc<Zero, b>> zero1, FSharpFunc<c, FSharpFunc<Zero, c>> zero2, FSharpFunc<d, FSharpFunc<Zero, d>> zero3, FSharpFunc<e, FSharpFunc<Zero, e>> zero4, (a, b, c, d, e) _arg1, Zero _arg2) { Zero zero5 = null; a item = FSharpFunc<a, FSharpPlus.Control.Zero>.InvokeFast<a>(zero, default(a), zero5); zero5 = null; b item2 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<b>((FSharpFunc<?, FSharpFunc<Zero, b>>)(object)zero1, default(b), zero5); zero5 = null; c item3 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<c>((FSharpFunc<?, FSharpFunc<Zero, c>>)(object)zero2, default(c), zero5); zero5 = null; d item4 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<d>((FSharpFunc<?, FSharpFunc<Zero, d>>)(object)zero3, default(d), zero5); zero5 = null; return ValueTuple.Create(item, item2, item3, item4, FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<e>((FSharpFunc<?, FSharpFunc<Zero, e>>)(object)zero4, default(e), zero5)); } public static (a, b, c, d, e, f) Zero<a, b, c, d, e, f>((a, b, c, d, e, f) _arg1, Zero _arg2) { Zero zero = null; if (false) { a item = (a)(object)null; zero = null; if (false) { b item2 = (b)(object)null; zero = null; if (false) { c item3 = (c)(object)null; zero = null; if (false) { d item4 = (d)(object)null; zero = null; if (false) { e item5 = (e)(object)null; zero = null; if (0 == 0) { throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } return ValueTuple.Create(item, item2, item3, item4, item5, (f)(object)null); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } public static (a, b, c, d, e, f) Zero$W<a, b, c, d, e, f>(FSharpFunc<a, FSharpFunc<Zero, a>> zero, FSharpFunc<b, FSharpFunc<Zero, b>> zero1, FSharpFunc<c, FSharpFunc<Zero, c>> zero2, FSharpFunc<d, FSharpFunc<Zero, d>> zero3, FSharpFunc<e, FSharpFunc<Zero, e>> zero4, FSharpFunc<f, FSharpFunc<Zero, f>> zero5, (a, b, c, d, e, f) _arg1, Zero _arg2) { Zero zero6 = null; a item = FSharpFunc<a, FSharpPlus.Control.Zero>.InvokeFast<a>(zero, default(a), zero6); zero6 = null; b item2 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<b>((FSharpFunc<?, FSharpFunc<Zero, b>>)(object)zero1, default(b), zero6); zero6 = null; c item3 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<c>((FSharpFunc<?, FSharpFunc<Zero, c>>)(object)zero2, default(c), zero6); zero6 = null; d item4 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<d>((FSharpFunc<?, FSharpFunc<Zero, d>>)(object)zero3, default(d), zero6); zero6 = null; e item5 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<e>((FSharpFunc<?, FSharpFunc<Zero, e>>)(object)zero4, default(e), zero6); zero6 = null; return ValueTuple.Create(item, item2, item3, item4, item5, FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<f>((FSharpFunc<?, FSharpFunc<Zero, f>>)(object)zero5, default(f), zero6)); } public static (a, b, c, d, e, f, g) Zero<a, b, c, d, e, f, g>((a, b, c, d, e, f, g) _arg1, Zero _arg2) { Zero zero = null; if (false) { a item = (a)(object)null; zero = null; if (false) { b item2 = (b)(object)null; zero = null; if (false) { c item3 = (c)(object)null; zero = null; if (false) { d item4 = (d)(object)null; zero = null; if (false) { e item5 = (e)(object)null; zero = null; if (false) { f item6 = (f)(object)null; zero = null; if (0 == 0) { throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } return ValueTuple.Create(item, item2, item3, item4, item5, item6, (g)(object)null); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } public static (a, b, c, d, e, f, g) Zero$W<a, b, c, d, e, f, g>(FSharpFunc<a, FSharpFunc<Zero, a>> zero, FSharpFunc<b, FSharpFunc<Zero, b>> zero1, FSharpFunc<c, FSharpFunc<Zero, c>> zero2, FSharpFunc<d, FSharpFunc<Zero, d>> zero3, FSharpFunc<e, FSharpFunc<Zero, e>> zero4, FSharpFunc<f, FSharpFunc<Zero, f>> zero5, FSharpFunc<g, FSharpFunc<Zero, g>> zero6, (a, b, c, d, e, f, g) _arg1, Zero _arg2) { Zero zero7 = null; a item = FSharpFunc<a, FSharpPlus.Control.Zero>.InvokeFast<a>(zero, default(a), zero7); zero7 = null; b item2 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<b>((FSharpFunc<?, FSharpFunc<Zero, b>>)(object)zero1, default(b), zero7); zero7 = null; c item3 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<c>((FSharpFunc<?, FSharpFunc<Zero, c>>)(object)zero2, default(c), zero7); zero7 = null; d item4 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<d>((FSharpFunc<?, FSharpFunc<Zero, d>>)(object)zero3, default(d), zero7); zero7 = null; e item5 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<e>((FSharpFunc<?, FSharpFunc<Zero, e>>)(object)zero4, default(e), zero7); zero7 = null; f item6 = FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<f>((FSharpFunc<?, FSharpFunc<Zero, f>>)(object)zero5, default(f), zero7); zero7 = null; return ValueTuple.Create(item, item2, item3, item4, item5, item6, FSharpFunc<?, FSharpPlus.Control.Zero>.InvokeFast<g>((FSharpFunc<?, FSharpFunc<Zero, g>>)(object)zero6, default(g), zero7)); } public static Task<a> Zero<a>(Task<a> _arg1, Zero _arg2) { Zero zero = null; if (0 == 0) { throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } a result = (a)(object)null; TaskCompletionSource<a> taskCompletionSource = new TaskCompletionSource<a>(); taskCompletionSource.SetResult(result); return taskCompletionSource.Task; } public static Task<a> Zero$W<a>(FSharpFunc<a, FSharpFunc<Zero, a>> zero, Task<a> _arg1, Zero _arg2) { Zero zero2 = null; a result = FSharpFunc<a, FSharpPlus.Control.Zero>.InvokeFast<a>(zero, default(a), zero2); TaskCompletionSource<a> taskCompletionSource = new TaskCompletionSource<a>(); taskCompletionSource.SetResult(result); return taskCompletionSource.Task; } public static ValueTask<a> Zero<a>(ValueTask<a> _arg3, Zero _arg4) { Zero zero = null; if (0 == 0) { throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } a result = (a)(object)null; return new ValueTask<a>(result); } public static ValueTask<a> Zero$W<a>(FSharpFunc<a, FSharpFunc<Zero, a>> zero, ValueTask<a> _arg3, Zero _arg4) { Zero zero2 = null; a result = FSharpFunc<a, FSharpPlus.Control.Zero>.InvokeFast<a>(zero, default(a), zero2); return new ValueTask<a>(result); } public static FSharpFunc<T, Monoid> Zero<T, Monoid>(FSharpFunc<T, Monoid> _arg5, Zero _arg6) { return $Numeric.Zero@201<T, Monoid>.@_instance; } public static FSharpFunc<T, Monoid> Zero$W<T, Monoid>(FSharpFunc<Monoid, FSharpFunc<Zero, Monoid>> zero, FSharpFunc<T, Monoid> _arg5, Zero _arg6) { return new $Numeric.Zero@201-1<T, Monoid>(zero); } public static FSharpAsync<a> Zero<a>(FSharpAsync<a> _arg7, Zero _arg8) { Zero zero = null; if (0 == 0) { throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } a v = (a)(object)null; return AsyncPrimitives.MakeAsync<a>((FSharpFunc<AsyncActivation<a>, AsyncReturn>)new $Numeric.Zero@202-2<a>(v)); } public static FSharpAsync<a> Zero$W<a>(FSharpFunc<a, FSharpFunc<Zero, a>> zero, FSharpAsync<a> _arg7, Zero _arg8) { Zero zero2 = null; a v = FSharpFunc<a, FSharpPlus.Control.Zero>.InvokeFast<a>(zero, default(a), zero2); return AsyncPrimitives.MakeAsync<a>((FSharpFunc<AsyncActivation<a>, AsyncReturn>)new $Numeric.Zero@202-3<a>(zero, v)); } public static FSharpExpr<a> Zero<a>(FSharpExpr<a> _arg9, Zero _arg10) { Zero zero = null; if (0 == 0) { throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } a val = (a)(object)null; return FSharpExpr.Cast<a>(FSharpExpr.Value<a>(val)); } public static FSharpExpr<a> Zero$W<a>(FSharpFunc<a, FSharpFunc<Zero, a>> zero, FSharpExpr<a> _arg9, Zero _arg10) { Zero zero2 = null; a val = FSharpFunc<a, FSharpPlus.Control.Zero>.InvokeFast<a>(zero, default(a), zero2); return FSharpExpr.Cast<a>(FSharpExpr.Value<a>(val)); } public static Lazy<a> Zero<a>(Lazy<a> _arg11, Zero _arg12) { Zero zero = null; if (0 == 0) { throw new NotSupportedException("Dynamic invocation of Zero is not supported"); } a v = (a)(object)null; return LazyExtensions.Create<a>((FSharpFunc<Unit, a>)new $Numeric.Zero@206-4<a>(v)); } public static Lazy<a> Zero$W<a>(FSharpFunc<a, FSharpFunc<Zero, a>> zero, Lazy<a> _arg11, Zero _arg12) { Zero zero2 = null; a v = FSharpFunc<a, FSharpPlus.Control.Zero>.InvokeFast<a>(zero, default(a), zero2); return LazyExtensions.Create<a>((FSharpFunc<Unit, a>)new $Numeric.Zero@206-5<a>(zero, v)); } public static Dictionary<a, b> Zero<a, b>(Dictionary<a, b> _arg13, Zero _arg14) { return new Dictionary<a, b>(); } public static List<a> Zero<a>(List<a> _arg15, Zero _arg16) { return new List<a>(); } public static R Zero<R>(R _arg1, Default6 _arg2) { FromInt64 item = null; return FSharpFunc<Tuple<FromInt64, R>, long>.InvokeFast<R>((FSharpFunc<Tuple<FromInt64, R>, FSharpFunc<long, R>>)$Numeric.Zero@211-6<R>.@_instance, new Tuple<FromInt64, R>(item, default(R)), 0L); } public static R Zero$W<R>(FSharpFunc<R, FSharpFunc<FromInt64, FSharpFunc<long, R>>> fromInt64, R _arg1, Default6 _arg2) { FromInt64 item = null; return FSharpFunc<Tuple<FromInt64, R>, long>.InvokeFast<R>((FSharpFunc<Tuple<FromInt64, R>, FSharpFunc<long, R>>)new $Numeric.Zero@211-7<R>(fromInt64), new Tuple<FromInt64, R>(item, default(R)), 0L); } public static R Zero<R>(R _arg3, Default5 _arg4) { throw new NotSupportedException("Dynamic invocation of op_Implicit is not supported"); } public static R Zero$W<R>(FSharpFunc<int, R> op_Implicit, R _arg3, Default5 _arg4) { return op_Implicit.Invoke(0); } public static IEnumerable<a> Zero<a>(IEnumerable<a> _arg5, Default4 _arg6) { return SeqModule.Empty<a>(); } public static IEnumerator<a> Zero<a>(IEnumerator<a> _arg7, Default4 _arg8) { return new Enumerator.EmptyEnumerator<a>(); } public static IDictionary<a, b> Zero<a, b>(IDictionary<a, b> _arg9, Default4 _arg10) { return new Dictionary<a, b>(); } public static IReadOnlyDictionary<a, b> Zero<a, b>(IReadOnlyDictionary<a, b> _arg11, Default4 _arg12) { return new Dictionary<a, b>(); } public static t Zero<t>(t _arg13, Default3 _arg14) { throw new NotSupportedException("Dynamic invocation of get_Empty is not supported"); } public static t Zero$W<t>(FSharpFunc<Unit, t> get_Empty, t _arg13, Default3 _arg14) { return get_Empty.Invoke((Unit)null); } public static t Zero<t>(t _arg15, Default2 _arg16) { throw new NotSupportedException("Dynamic invocation of FromInt32 is not supported"); } public static t Zero$W<t>(FSharpFunc<int, t> fromInt32, t _arg15, Default2 _arg16) { return fromInt32.Invoke(0); } public static FSharpFunc<a, a> Zero<t, a>(t _arg17, Default2 _arg18) where t : class { return $Numeric.Zero@222-8<a>.@_instance; } public static t Zero<t>(t _arg19, Default1 _arg20) { return LanguagePrimitives.GenericZeroDynamic<t>(); } public static t Zero$W<t>(FSharpFunc<Unit, t> get_Zero, t _arg19, Default1 _arg20) { return get_Zero.Invoke((Unit)null); } public static FSharpFunc<a, a> Zero<t, a>(t _arg21, Default1 _arg22) where t : class { return $Numeric.Zero@225-9<a>.@_instance; } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class Abs : Default1 { public static t Abs<t, u>(t x, Default2 _arg1) { if (0 == 0) { throw new NotSupportedException("Dynamic invocation of Abs is not supported"); } u val = (u)(object)null; Explicit item = null; return FSharpFunc<Tuple<Explicit, t>, ?>.InvokeFast<t>((FSharpFunc<Tuple<Explicit, t>, FSharpFunc<?, t>>)(object)$Numeric.Abs@231<t, u>.@_instance, new Tuple<Explicit, t>(item, default(t)), val); } public static t Abs$W<t,
BepInEx/core/Mirage.Core/FSharpx.Async.dll
Decompiled a month ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Net; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.ExceptionServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Text; using System.Threading; using System.Threading.Tasks; using <StartupCode$FSharpx-Async>; using <StartupCode$FSharpx-Async>.$Async; using FSharp.Control; using FSharpx.Collections.Mutable; using FSharpx.Control; using FSharpx.IO; using Microsoft.FSharp.Collections; using Microsoft.FSharp.Control; using Microsoft.FSharp.Core; using Microsoft.FSharp.Core.CompilerServices; [assembly: FSharpInterfaceDataVersion(2, 0, 0)] [assembly: TargetFramework(".NETFramework,Version=v4.5.2", FrameworkDisplayName = ".NET Framework 4.5.2")] [assembly: AssemblyCompany("Tomas Petricek;David Thomas;Ryan Riley;Steffen Forkmann")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Async extensions for F#")] [assembly: AssemblyFileVersion("1.14.2.0")] [assembly: AssemblyInformationalVersion("1.14.2+b63df53c523701e74e5dea8989289a1426c05cdb")] [assembly: AssemblyProduct("FSharpx.Async")] [assembly: AssemblyTitle("FSharpx.Async")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/fsprojects/FSharpx.Async")] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default)] [assembly: AssemblyVersion("1.14.2.0")] namespace FSharpx.Collections.Mutable { [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class CircularBuffer<T> : IEnumerable<T> { internal int bufferSize; internal T[] buffer; internal int head; internal int tail; internal int length; public int Count => length; public CircularBuffer(int bufferSize) { this.bufferSize = bufferSize; if (this.bufferSize <= 0) { throw new ArgumentException("The bufferSize must be greater than 0.", "bufferSize"); } buffer = ArrayModule.ZeroCreate<T>(this.bufferSize); head = this.bufferSize - 1; tail = 0; length = 0; } public T[] Dequeue(int count) { if (length == 0) { throw new InvalidOperationException("Queue exhausted."); } if (count > bufferSize) { ArgumentOutOfRangeException ex = new ArgumentOutOfRangeException("Requested count exceeds the buffer size."); throw ex; } int num = length; int num2 = ((count >= num) ? num : count); T[] result = ArrayModule.Concat<T>((IEnumerable<T[]>)SeqModule.ToArray<T[]>((IEnumerable<T[]>)(object)new $CircularBuffer.dequeued@37<T>(this, num2, null, 0, null))); tail = (tail + num2) % bufferSize; length -= num2; return result; } public void Enqueue(T[] value, int offset, int count) { if (count > bufferSize) { throw new InvalidOperationException("Requested count is too large."); } int num = offset; head = (head + 1) % bufferSize; IEnumerable<Tuple<int, int>> enumerable = nextBuffer(head, count); int item; int item2; int sourceIndex; foreach (Tuple<int, int> item3 in enumerable) { item = item3.Item2; item2 = item3.Item1; sourceIndex = num; T[] destinationArray = buffer; Array.Copy(value, sourceIndex, destinationArray, item2, item); num += item; } if (length == bufferSize) { tail = (tail + count) % bufferSize; return; } item = length + count - bufferSize; if (item > 0) { tail = (tail + item) % bufferSize; } item2 = length + count; sourceIndex = bufferSize; length = ((item2 >= sourceIndex) ? sourceIndex : item2); } public void Enqueue(T[] value) { Enqueue(value, 0, value.Length); } public void Enqueue(T[] value, int offset) { Enqueue(value, offset, value.Length - offset); } public void Enqueue(ArraySegment<T> value) { Enqueue(value.Array, value.Offset, value.Count); } public void Enqueue(T value) { Enqueue(new T[1] { value }, 0, 1); } public IEnumerator<T> GetEnumerator() { return $CircularBuffer.loop@74(this, null).GetEnumerator(); } virtual IEnumerator<T> IEnumerable<T>.GetEnumerator() { return GetEnumerator(); } virtual IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } [CompilationArgumentCounts(new int[] { 1, 1 })] [CompilerGenerated] internal IEnumerable<Tuple<int, int>> nextBuffer(int offset, int count) { return (IEnumerable<Tuple<int, int>>)(object)new $CircularBuffer.clo@20<T>(this, offset, count, 0, 0, null); } } } namespace FSharpx.Control { [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class AutoCancelAgent<T> : IDisposable { internal FSharpMailboxProcessor<T> mbox; internal CancellationTokenSource cts; public int CurrentQueueLength => mbox.CurrentQueueLength; [CLIEvent] public event FSharpHandler<Exception> Error { add { FSharpMailboxProcessor<T> eventTarget = mbox; ((IDelegateEvent<FSharpHandler<Exception>>)(object)RuntimeHelpers.CreateEvent<FSharpHandler<Exception>, Exception>((FSharpFunc<FSharpHandler<Exception>, Unit>)new $AutoCancelAgent.add_Error@29<T>(eventTarget), (FSharpFunc<FSharpHandler<Exception>, Unit>)new $AutoCancelAgent.add_Error@29-1<T>(eventTarget), (FSharpFunc<FSharpFunc<object, FSharpFunc<Exception, Unit>>, FSharpHandler<Exception>>)$AutoCancelAgent.add_Error@29-2.@_instance)).AddHandler(value); } remove { FSharpMailboxProcessor<T> eventTarget = mbox; ((IDelegateEvent<FSharpHandler<Exception>>)(object)RuntimeHelpers.CreateEvent<FSharpHandler<Exception>, Exception>((FSharpFunc<FSharpHandler<Exception>, Unit>)new $AutoCancelAgent.remove_Error@29<T>(eventTarget), (FSharpFunc<FSharpHandler<Exception>, Unit>)new $AutoCancelAgent.remove_Error@29-1<T>(eventTarget), (FSharpFunc<FSharpFunc<object, FSharpFunc<Exception, Unit>>, FSharpHandler<Exception>>)$AutoCancelAgent.remove_Error@29-2.@_instance)).RemoveHandler(value); } } internal AutoCancelAgent(FSharpMailboxProcessor<T> mbox, CancellationTokenSource cts) { this.mbox = mbox; this.cts = cts; } public static AutoCancelAgent<T> Start(FSharpFunc<FSharpMailboxProcessor<T>, FSharpAsync<Unit>> f) { CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(); return new AutoCancelAgent<T>(FSharpMailboxProcessor<T>.Start(f, FSharpOption<CancellationToken>.Some(cancellationTokenSource.Token)), cancellationTokenSource); } public FSharpAsync<T> Receive([OptionalArgument] FSharpOption<int> timeout) { return mbox.Receive(timeout); } public FSharpAsync<a> Scan<a>(FSharpFunc<T, FSharpOption<FSharpAsync<a>>> scanner, [OptionalArgument] FSharpOption<int> timeout) { return mbox.Scan<a>(scanner, timeout); } public FSharpOption<a> TryPostAndReply<a>(FSharpFunc<FSharpAsyncReplyChannel<a>, T> buildMessage, [OptionalArgument] FSharpOption<int> timeout) { return mbox.TryPostAndReply<a>(buildMessage, timeout); } public FSharpAsync<FSharpOption<T>> TryReceive([OptionalArgument] FSharpOption<int> timeout) { return mbox.TryReceive(timeout); } public FSharpAsync<FSharpOption<a>> TryScan<a>(FSharpFunc<T, FSharpOption<FSharpAsync<a>>> scanner, [OptionalArgument] FSharpOption<int> timeout) { return mbox.TryScan<a>(scanner, timeout); } public void Post(T m) { mbox.Post(m); } public a PostAndReply<a>(FSharpFunc<FSharpAsyncReplyChannel<a>, T> buildMessage, [OptionalArgument] FSharpOption<int> timeout) { return mbox.PostAndReply<a>(buildMessage, timeout); } public FSharpAsync<FSharpOption<a>> PostAndTryAsyncReply<a>(FSharpFunc<FSharpAsyncReplyChannel<a>, T> buildMessage, [OptionalArgument] FSharpOption<int> timeout) { return mbox.PostAndTryAsyncReply<a>(buildMessage, timeout); } public FSharpAsync<a> PostAndAsyncReply<a>(FSharpFunc<FSharpAsyncReplyChannel<a>, T> buildMessage, [OptionalArgument] FSharpOption<int> timeout) { return mbox.PostAndAsyncReply<a>(buildMessage, timeout); } virtual void IDisposable.Dispose() { ((IDisposable)mbox).Dispose(); cts.Cancel(); } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class BatchProcessingAgent<T> : IDisposable { internal int timeout; internal int batchSize; internal FSharpEvent<T[]> batchEvent; internal CancellationTokenSource cts; internal FSharpMailboxProcessor<T> agent; [CLIEvent] public event FSharpHandler<T[]> BatchProduced { add { ((IDelegateEvent<FSharpHandler<FSharpHandler<T[]>[]>>)(object)((FSharpEvent<T[][]>)(object)batchEvent).Publish).AddHandler((FSharpHandler<FSharpHandler<T[]>[]>)(object)value); } remove { ((IDelegateEvent<FSharpHandler<FSharpHandler<T[]>[]>>)(object)((FSharpEvent<T[][]>)(object)batchEvent).Publish).RemoveHandler((FSharpHandler<FSharpHandler<T[]>[]>)(object)value); } } public BatchProcessingAgent(int batchSize, int timeout) { this.batchSize = batchSize; this.timeout = timeout; batchEvent = (FSharpEvent<T[]>)(object)new FSharpEvent<T[][]>(); cts = new CancellationTokenSource(); agent = FSharpMailboxProcessor<T>.Start((FSharpFunc<FSharpMailboxProcessor<T>, FSharpAsync<Unit>>)new $BatchProcessingAgent.-ctor@39<T>(this), FSharpOption<CancellationToken>.Some(cts.Token)); } public void Enqueue(T v) { agent.Post(v); } virtual void IDisposable.Dispose() { cts.Cancel(); } [CompilerGenerated] internal FSharpAsync<b> body<b>(FSharpMailboxProcessor<T> agent) { return $BatchProcessingAgent.loop@23-2<T, b>(this, agent, timeout, FSharpList<T>.Empty); } } [Serializable] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [DebuggerDisplay("{__DebugDisplay(),nq}")] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal abstract class BlockingAgentMessage<T> : IEquatable<BlockingAgentMessage<T>>, IStructuralEquatable { internal static class Tags { public const int AsyncAdd = 0; public const int Add = 1; public const int AsyncGet = 2; } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(BlockingAgentMessage<>.AsyncAdd@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] internal class AsyncAdd : BlockingAgentMessage<T> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T item1; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly FSharpAsyncReplyChannel<Unit> item2; [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] internal T Item1 { [CompilerGenerated] [DebuggerNonUserCode] get { return item1; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] internal FSharpAsyncReplyChannel<Unit> Item2 { [CompilerGenerated] [DebuggerNonUserCode] get { return item2; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(BlockingAgentMessage<>))] [CompilerGenerated] [DebuggerNonUserCode] internal AsyncAdd(T item1, FSharpAsyncReplyChannel<Unit> item2) { this.item1 = item1; this.item2 = item2; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(BlockingAgentMessage<>.Add@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] internal class Add : BlockingAgentMessage<T> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T item; [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] internal T Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(BlockingAgentMessage<>))] [CompilerGenerated] [DebuggerNonUserCode] internal Add(T item) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(BlockingAgentMessage<>.AsyncGet@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] internal class AsyncGet : BlockingAgentMessage<T> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly FSharpAsyncReplyChannel<T> item; [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] internal FSharpAsyncReplyChannel<T> Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(BlockingAgentMessage<>))] [CompilerGenerated] [DebuggerNonUserCode] internal AsyncGet(FSharpAsyncReplyChannel<T> item) { this.item = item; } } [SpecialName] internal class AsyncAdd@DebugTypeProxy { [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public T Item1 { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item1; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpAsyncReplyChannel<Unit> Item2 { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item2; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(BlockingAgentMessage<>))] [CompilerGenerated] [DebuggerNonUserCode] public AsyncAdd@DebugTypeProxy(AsyncAdd obj) { _obj = obj; } } [SpecialName] internal class Add@DebugTypeProxy { [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public T Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(BlockingAgentMessage<>))] [CompilerGenerated] [DebuggerNonUserCode] public Add@DebugTypeProxy(Add obj) { _obj = obj; } } [SpecialName] internal class AsyncGet@DebugTypeProxy { [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpAsyncReplyChannel<T> Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(BlockingAgentMessage<>))] [CompilerGenerated] [DebuggerNonUserCode] public AsyncGet@DebugTypeProxy(AsyncGet obj) { _obj = obj; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal int Tag { [CompilerGenerated] [DebuggerNonUserCode] get { return (this is AsyncGet) ? 2 : ((this is Add) ? 1 : 0); } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool IsAsyncAdd { [CompilerGenerated] [DebuggerNonUserCode] get { return this is AsyncAdd; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool IsAdd { [CompilerGenerated] [DebuggerNonUserCode] get { return this is Add; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool IsAsyncGet { [CompilerGenerated] [DebuggerNonUserCode] get { return this is AsyncGet; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicNestedTypes | DynamicallyAccessedMemberTypes.NonPublicNestedTypes | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(BlockingAgentMessage<>))] [CompilerGenerated] [DebuggerNonUserCode] internal BlockingAgentMessage() { } [CompilationMapping(/*Could not decode attribute arguments.*/)] internal static BlockingAgentMessage<T> NewAsyncAdd(T item1, FSharpAsyncReplyChannel<Unit> item2) { return new AsyncAdd(item1, item2); } [CompilationMapping(/*Could not decode attribute arguments.*/)] internal static BlockingAgentMessage<T> NewAdd(T item) { return new Add(item); } [CompilationMapping(/*Could not decode attribute arguments.*/)] internal static BlockingAgentMessage<T> NewAsyncGet(FSharpAsyncReplyChannel<T> item) { return new AsyncGet(item); } [SpecialName] [CompilerGenerated] [DebuggerNonUserCode] internal object __DebugDisplay() { return ((FSharpFunc<BlockingAgentMessage<BlockingAgentMessage<T>>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<BlockingAgentMessage<T>, string>>((PrintfFormat<FSharpFunc<BlockingAgentMessage<T>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<BlockingAgentMessage<FSharpFunc<BlockingAgentMessage<T>, string>>, string>, Unit, string, string, string>("%+0.8A"))).Invoke((BlockingAgentMessage<BlockingAgentMessage<T>>)(object)this); } [CompilerGenerated] public override string ToString() { return ((FSharpFunc<BlockingAgentMessage<BlockingAgentMessage<T>>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<BlockingAgentMessage<T>, string>>((PrintfFormat<FSharpFunc<BlockingAgentMessage<T>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<BlockingAgentMessage<FSharpFunc<BlockingAgentMessage<T>, string>>, string>, Unit, string, string, BlockingAgentMessage<FSharpFunc<BlockingAgentMessage<T>, string>>>("%+A"))).Invoke((BlockingAgentMessage<BlockingAgentMessage<T>>)(object)this); } [CompilerGenerated] public virtual sealed int GetHashCode(IEqualityComparer comp) { if (this != null) { int num = 0; T item; if (!(this is AsyncAdd)) { if (this is Add) { Add add = (Add)this; num = 1; item = add.item; return -1640531527 + (HashCompare.GenericHashWithComparerIntrinsic<T>(comp, item) + ((num << 6) + (num >> 2))); } if (this is AsyncGet) { AsyncGet asyncGet = (AsyncGet)this; num = 2; return -1640531527 + (HashCompare.GenericHashWithComparerIntrinsic<FSharpAsyncReplyChannel<T>>(comp, asyncGet.item) + ((num << 6) + (num >> 2))); } } AsyncAdd asyncAdd = (AsyncAdd)this; num = 0; num = -1640531527 + (HashCompare.GenericHashWithComparerIntrinsic<FSharpAsyncReplyChannel<Unit>>(comp, asyncAdd.item2) + ((num << 6) + (num >> 2))); item = asyncAdd.item1; return -1640531527 + (HashCompare.GenericHashWithComparerIntrinsic<T>(comp, item) + ((num << 6) + (num >> 2))); } return 0; } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public virtual sealed bool Equals(object obj, IEqualityComparer comp) { if (this != null) { if (obj is BlockingAgentMessage<T> blockingAgentMessage) { int num = ((this is AsyncGet) ? 2 : ((this is Add) ? 1 : 0)); BlockingAgentMessage<T> blockingAgentMessage2 = blockingAgentMessage; int num2 = ((blockingAgentMessage2 is AsyncGet) ? 2 : ((blockingAgentMessage2 is Add) ? 1 : 0)); if (num == num2) { T item; T item2; if (!(this is AsyncAdd)) { if (this is Add) { Add add = (Add)this; Add add2 = (Add)blockingAgentMessage; item = add.item; item2 = add2.item; return HashCompare.GenericEqualityWithComparerIntrinsic<T>(comp, item, item2); } if (this is AsyncGet) { AsyncGet asyncGet = (AsyncGet)this; AsyncGet asyncGet2 = (AsyncGet)blockingAgentMessage; return HashCompare.GenericEqualityWithComparerIntrinsic<FSharpAsyncReplyChannel<T>>(comp, asyncGet.item, asyncGet2.item); } } AsyncAdd asyncAdd = (AsyncAdd)this; AsyncAdd asyncAdd2 = (AsyncAdd)blockingAgentMessage; item = asyncAdd.item1; item2 = asyncAdd2.item1; if (HashCompare.GenericEqualityWithComparerIntrinsic<T>(comp, item, item2)) { return HashCompare.GenericEqualityWithComparerIntrinsic<FSharpAsyncReplyChannel<Unit>>(comp, asyncAdd.item2, asyncAdd2.item2); } return false; } return false; } return false; } return obj == null; } [CompilerGenerated] public virtual sealed bool Equals(BlockingAgentMessage<T> obj) { if (this != null) { if (obj != null) { int num = ((this is AsyncGet) ? 2 : ((this is Add) ? 1 : 0)); int num2 = ((obj is AsyncGet) ? 2 : ((obj is Add) ? 1 : 0)); if (num == num2) { T item; T item2; if (!(this is AsyncAdd)) { if (this is Add) { Add add = (Add)this; Add add2 = (Add)obj; item = add.item; item2 = add2.item; return HashCompare.GenericEqualityERIntrinsic<T>(item, item2); } if (this is AsyncGet) { AsyncGet asyncGet = (AsyncGet)this; AsyncGet asyncGet2 = (AsyncGet)obj; return HashCompare.GenericEqualityERIntrinsic<FSharpAsyncReplyChannel<T>>(asyncGet.item, asyncGet2.item); } } AsyncAdd asyncAdd = (AsyncAdd)this; AsyncAdd asyncAdd2 = (AsyncAdd)obj; item = asyncAdd.item1; item2 = asyncAdd2.item1; if (HashCompare.GenericEqualityERIntrinsic<T>(item, item2)) { return HashCompare.GenericEqualityERIntrinsic<FSharpAsyncReplyChannel<Unit>>(asyncAdd.item2, asyncAdd2.item2); } return false; } return false; } return false; } return obj == null; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is BlockingAgentMessage<T> obj2) { return Equals(obj2); } return false; } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class BlockingQueueAgent<T> : IDisposable { [VolatileField] internal int count; internal FSharpMailboxProcessor<BlockingAgentMessage<T>> agent; public int Count => count; public BlockingQueueAgent(int maxLength) { count = 0; agent = FSharpMailboxProcessor<BlockingAgentMessage<BlockingAgentMessage<T>>>.Start((FSharpFunc<FSharpMailboxProcessor<BlockingAgentMessage<BlockingAgentMessage<T>>>, FSharpAsync<Unit>>)(object)new $BlockingQueueAgent.-ctor@26-1<T>(this, maxLength), (FSharpOption<CancellationToken>)null); } public FSharpAsync<Unit> AsyncAdd(T v, [OptionalArgument] FSharpOption<int> timeout) { return ((FSharpMailboxProcessor<BlockingAgentMessage<BlockingAgentMessage<T>>>)(object)agent).PostAndAsyncReply<Unit>((FSharpFunc<FSharpAsyncReplyChannel<Unit>, BlockingAgentMessage<BlockingAgentMessage<T>>>)(object)new $BlockingQueueAgent.AsyncAdd@78<T>(v), timeout); } public void Add(T v) { ((FSharpMailboxProcessor<BlockingAgentMessage<BlockingAgentMessage<T>>>)(object)agent).Post((BlockingAgentMessage<BlockingAgentMessage<T>>)(object)BlockingAgentMessage<T>.NewAdd(v)); } public FSharpAsync<T> AsyncGet([OptionalArgument] FSharpOption<int> timeout) { return ((FSharpMailboxProcessor<BlockingAgentMessage<BlockingAgentMessage<T>>>)(object)agent).PostAndAsyncReply<T>((FSharpFunc<FSharpAsyncReplyChannel<T>, BlockingAgentMessage<BlockingAgentMessage<T>>>)(object)$BlockingQueueAgent.AsyncGet@90<T>.@_instance, timeout); } public T Get([OptionalArgument] FSharpOption<int> timeout) { return ((FSharpMailboxProcessor<BlockingAgentMessage<BlockingAgentMessage<T>>>)(object)agent).PostAndReply<T>((FSharpFunc<FSharpAsyncReplyChannel<T>, BlockingAgentMessage<BlockingAgentMessage<T>>>)(object)$BlockingQueueAgent.Get@96<T>.@_instance, timeout); } virtual void IDisposable.Dispose() { ((IDisposable)agent).Dispose(); } } [Serializable] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [DebuggerDisplay("{__DebugDisplay(),nq}")] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal abstract class CircularQueueMessage<T> : IEquatable<CircularQueueMessage<T>>, IStructuralEquatable { internal static class Tags { public const int AsyncEnqueue = 0; public const int Enqueue = 1; public const int AsyncDequeue = 2; } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(CircularQueueMessage<>.AsyncEnqueue@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] internal class AsyncEnqueue : CircularQueueMessage<T> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T[] item1; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly int item2; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly int item3; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly FSharpAsyncReplyChannel<Unit> item4; [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] internal T[] Item1 { [CompilerGenerated] [DebuggerNonUserCode] get { return item1; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] internal int Item2 { [CompilerGenerated] [DebuggerNonUserCode] get { return item2; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] internal int Item3 { [CompilerGenerated] [DebuggerNonUserCode] get { return item3; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] internal FSharpAsyncReplyChannel<Unit> Item4 { [CompilerGenerated] [DebuggerNonUserCode] get { return item4; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(CircularQueueMessage<>))] [CompilerGenerated] [DebuggerNonUserCode] internal AsyncEnqueue(T[] item1, int item2, int item3, FSharpAsyncReplyChannel<Unit> item4) { this.item1 = item1; this.item2 = item2; this.item3 = item3; this.item4 = item4; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(CircularQueueMessage<>.Enqueue@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] internal class Enqueue : CircularQueueMessage<T> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T[] item1; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly int item2; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly int item3; [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] internal T[] Item1 { [CompilerGenerated] [DebuggerNonUserCode] get { return item1; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] internal int Item2 { [CompilerGenerated] [DebuggerNonUserCode] get { return item2; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] internal int Item3 { [CompilerGenerated] [DebuggerNonUserCode] get { return item3; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(CircularQueueMessage<>))] [CompilerGenerated] [DebuggerNonUserCode] internal Enqueue(T[] item1, int item2, int item3) { this.item1 = item1; this.item2 = item2; this.item3 = item3; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(CircularQueueMessage<>.AsyncDequeue@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] internal class AsyncDequeue : CircularQueueMessage<T> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly int item1; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly FSharpAsyncReplyChannel<T[]> item2; [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] internal int Item1 { [CompilerGenerated] [DebuggerNonUserCode] get { return item1; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] internal FSharpAsyncReplyChannel<T[]> Item2 { [CompilerGenerated] [DebuggerNonUserCode] get { return item2; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(CircularQueueMessage<>))] [CompilerGenerated] [DebuggerNonUserCode] internal AsyncDequeue(int item1, FSharpAsyncReplyChannel<T[]> item2) { this.item1 = item1; this.item2 = item2; } } [SpecialName] internal class AsyncEnqueue@DebugTypeProxy { [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public T[] Item1 { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item1; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public int Item2 { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item2; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public int Item3 { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item3; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpAsyncReplyChannel<Unit> Item4 { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item4; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(CircularQueueMessage<>))] [CompilerGenerated] [DebuggerNonUserCode] public AsyncEnqueue@DebugTypeProxy(AsyncEnqueue obj) { _obj = obj; } } [SpecialName] internal class Enqueue@DebugTypeProxy { [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public T[] Item1 { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item1; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public int Item2 { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item2; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public int Item3 { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item3; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(CircularQueueMessage<>))] [CompilerGenerated] [DebuggerNonUserCode] public Enqueue@DebugTypeProxy(Enqueue obj) { _obj = obj; } } [SpecialName] internal class AsyncDequeue@DebugTypeProxy { [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public int Item1 { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item1; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpAsyncReplyChannel<T[]> Item2 { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item2; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(CircularQueueMessage<>))] [CompilerGenerated] [DebuggerNonUserCode] public AsyncDequeue@DebugTypeProxy(AsyncDequeue obj) { _obj = obj; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal int Tag { [CompilerGenerated] [DebuggerNonUserCode] get { return (this is AsyncDequeue) ? 2 : ((this is Enqueue) ? 1 : 0); } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool IsAsyncEnqueue { [CompilerGenerated] [DebuggerNonUserCode] get { return this is AsyncEnqueue; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool IsEnqueue { [CompilerGenerated] [DebuggerNonUserCode] get { return this is Enqueue; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool IsAsyncDequeue { [CompilerGenerated] [DebuggerNonUserCode] get { return this is AsyncDequeue; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicNestedTypes | DynamicallyAccessedMemberTypes.NonPublicNestedTypes | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(CircularQueueMessage<>))] [CompilerGenerated] [DebuggerNonUserCode] internal CircularQueueMessage() { } [CompilationMapping(/*Could not decode attribute arguments.*/)] internal static CircularQueueMessage<T> NewAsyncEnqueue(T[] item1, int item2, int item3, FSharpAsyncReplyChannel<Unit> item4) { return new AsyncEnqueue(item1, item2, item3, item4); } [CompilationMapping(/*Could not decode attribute arguments.*/)] internal static CircularQueueMessage<T> NewEnqueue(T[] item1, int item2, int item3) { return new Enqueue(item1, item2, item3); } [CompilationMapping(/*Could not decode attribute arguments.*/)] internal static CircularQueueMessage<T> NewAsyncDequeue(int item1, FSharpAsyncReplyChannel<T[]> item2) { return new AsyncDequeue(item1, item2); } [SpecialName] [CompilerGenerated] [DebuggerNonUserCode] internal object __DebugDisplay() { return ((FSharpFunc<CircularQueueMessage<CircularQueueMessage<T>>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<CircularQueueMessage<T>, string>>((PrintfFormat<FSharpFunc<CircularQueueMessage<T>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<CircularQueueMessage<FSharpFunc<CircularQueueMessage<T>, string>>, string>, Unit, string, string, string>("%+0.8A"))).Invoke((CircularQueueMessage<CircularQueueMessage<T>>)(object)this); } [CompilerGenerated] public override string ToString() { return ((FSharpFunc<CircularQueueMessage<CircularQueueMessage<T>>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<CircularQueueMessage<T>, string>>((PrintfFormat<FSharpFunc<CircularQueueMessage<T>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<CircularQueueMessage<FSharpFunc<CircularQueueMessage<T>, string>>, string>, Unit, string, string, CircularQueueMessage<FSharpFunc<CircularQueueMessage<T>, string>>>("%+A"))).Invoke((CircularQueueMessage<CircularQueueMessage<T>>)(object)this); } [CompilerGenerated] public virtual sealed int GetHashCode(IEqualityComparer comp) { if (this != null) { return $CircularQueueAgent.GetHashCode$cont@13(comp, this, null); } return 0; } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public virtual sealed bool Equals(object obj, IEqualityComparer comp) { if (this != null) { if (obj is CircularQueueMessage<T> circularQueueMessage) { int num = ((this is AsyncDequeue) ? 2 : ((this is Enqueue) ? 1 : 0)); CircularQueueMessage<T> circularQueueMessage2 = circularQueueMessage; int num2 = ((circularQueueMessage2 is AsyncDequeue) ? 2 : ((circularQueueMessage2 is Enqueue) ? 1 : 0)); if (num == num2) { return $CircularQueueAgent.Equals$cont@13(this, circularQueueMessage, comp, null); } return false; } return false; } return obj == null; } [CompilerGenerated] public virtual sealed bool Equals(CircularQueueMessage<T> obj) { if (this != null) { if (obj != null) { int num = ((this is AsyncDequeue) ? 2 : ((this is Enqueue) ? 1 : 0)); int num2 = ((obj is AsyncDequeue) ? 2 : ((obj is Enqueue) ? 1 : 0)); if (num == num2) { return $CircularQueueAgent.Equals$cont@13-1(this, obj, null); } return false; } return false; } return obj == null; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is CircularQueueMessage<T> obj2) { return Equals(obj2); } return false; } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class CircularQueueAgent<T> { [VolatileField] internal int count; internal FSharpMailboxProcessor<CircularQueueMessage<T>> agent; public int Count => count; public CircularQueueAgent(int maxLength) { count = 0; agent = FSharpMailboxProcessor<CircularQueueMessage<CircularQueueMessage<T>>>.Start((FSharpFunc<FSharpMailboxProcessor<CircularQueueMessage<CircularQueueMessage<T>>>, FSharpAsync<Unit>>)(object)new $CircularQueueAgent.-ctor@26-2<T>(this, maxLength), (FSharpOption<CancellationToken>)null); } public FSharpAsync<Unit> AsyncEnqueue(T[] value, int offset, int count, [OptionalArgument] FSharpOption<int> timeout) { return ((FSharpMailboxProcessor<CircularQueueMessage<CircularQueueMessage<T>>>)(object)agent).PostAndAsyncReply<Unit>((FSharpFunc<FSharpAsyncReplyChannel<Unit>, CircularQueueMessage<CircularQueueMessage<T>>>)(object)new $CircularQueueAgent.AsyncEnqueue@80<T>(value, offset, count), timeout); } public FSharpAsync<Unit> AsyncEnqueue(ArraySegment<T> segment, [OptionalArgument] FSharpOption<int> timeout) { return ((FSharpMailboxProcessor<CircularQueueMessage<CircularQueueMessage<T>>>)(object)agent).PostAndAsyncReply<Unit>((FSharpFunc<FSharpAsyncReplyChannel<Unit>, CircularQueueMessage<CircularQueueMessage<T>>>)(object)new $CircularQueueAgent.AsyncEnqueue@86-1<T>(segment), timeout); } public FSharpAsync<Unit> AsyncEnqueue(T[] value, [OptionalArgument] FSharpOption<int> timeout) { return ((FSharpMailboxProcessor<CircularQueueMessage<CircularQueueMessage<T>>>)(object)agent).PostAndAsyncReply<Unit>((FSharpFunc<FSharpAsyncReplyChannel<Unit>, CircularQueueMessage<CircularQueueMessage<T>>>)(object)new $CircularQueueAgent.AsyncEnqueue@92-2<T>(value), timeout); } public void Enqueue(T[] value, int offset, int count) { ((FSharpMailboxProcessor<CircularQueueMessage<CircularQueueMessage<T>>>)(object)agent).Post((CircularQueueMessage<CircularQueueMessage<T>>)(object)CircularQueueMessage<T>.NewEnqueue(value, offset, count)); } public void Enqueue(ArraySegment<T> segment) { ((FSharpMailboxProcessor<CircularQueueMessage<CircularQueueMessage<T>>>)(object)agent).Post((CircularQueueMessage<CircularQueueMessage<T>>)(object)CircularQueueMessage<T>.NewEnqueue(segment.Array, segment.Offset, segment.Count)); } public void Enqueue(T[] value) { ((FSharpMailboxProcessor<CircularQueueMessage<CircularQueueMessage<T>>>)(object)agent).Post((CircularQueueMessage<CircularQueueMessage<T>>)(object)CircularQueueMessage<T>.NewEnqueue(value, 0, value.Length)); } public FSharpAsync<T[]> AsyncDequeue(int count, [OptionalArgument] FSharpOption<int> timeout) { return ((FSharpMailboxProcessor<CircularQueueMessage<CircularQueueMessage<T>>>)(object)agent).PostAndAsyncReply<T[]>((FSharpFunc<FSharpAsyncReplyChannel<T[]>, CircularQueueMessage<CircularQueueMessage<T>>>)(object)new $CircularQueueAgent.AsyncDequeue@115<T>(count), timeout); } public T[] Dequeue(int count, [OptionalArgument] FSharpOption<int> timeout) { return ((FSharpMailboxProcessor<CircularQueueMessage<CircularQueueMessage<T>>>)(object)agent).PostAndReply<T[]>((FSharpFunc<FSharpAsyncReplyChannel<T[]>, CircularQueueMessage<CircularQueueMessage<T>>>)(object)new $CircularQueueAgent.Dequeue@121<T>(count), timeout); } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class ConcurrentSetAgent<T> { internal FSharpMailboxProcessor<Tuple<object, FSharpAsyncReplyChannel<bool>>> agent; public ConcurrentSetAgent() { agent = FSharpMailboxProcessor<Tuple<object, FSharpAsyncReplyChannel<bool>>>.Start((FSharpFunc<FSharpMailboxProcessor<Tuple<object, FSharpAsyncReplyChannel<bool>>>, FSharpAsync<Unit>>)$ConcurrentSetAgent.-ctor@16-3.@_instance, (FSharpOption<CancellationToken>)null); } public FSharpAsync<bool> AsyncAdd(object v) { return agent.PostAndAsyncReply<bool>((FSharpFunc<FSharpAsyncReplyChannel<bool>, Tuple<object, FSharpAsyncReplyChannel<bool>>>)new $ConcurrentSetAgent.AsyncAdd@25-1(v), (FSharpOption<int>)null); } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class SlidingWindowAgent<T> { internal FSharpEvent<T[]> windowEvent; internal FSharpMailboxProcessor<T> agent; [CLIEvent] public event FSharpHandler<T[]> WindowProduced { add { ((IDelegateEvent<FSharpHandler<FSharpHandler<T[]>[]>>)(object)((FSharpEvent<T[][]>)(object)windowEvent).Publish).AddHandler((FSharpHandler<FSharpHandler<T[]>[]>)(object)value); } remove { ((IDelegateEvent<FSharpHandler<FSharpHandler<T[]>[]>>)(object)((FSharpEvent<T[][]>)(object)windowEvent).Publish).RemoveHandler((FSharpHandler<FSharpHandler<T[]>[]>)(object)value); } } public SlidingWindowAgent(int windowSize, [OptionalArgument] FSharpOption<CancellationToken> cancelToken) { windowEvent = (FSharpEvent<T[]>)(object)new FSharpEvent<T[][]>(); agent = FSharpMailboxProcessor<T>.Start((FSharpFunc<FSharpMailboxProcessor<T>, FSharpAsync<Unit>>)new $SlidingWindowAgent.-ctor@22-9<T>(this, windowSize), cancelToken); } public void Enqueue(T v) { agent.Post(v); } } [Serializable] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [DebuggerDisplay("{__DebugDisplay(),nq}")] [CompilationMapping(/*Could not decode attribute arguments.*/)] public abstract class ObservableUpdate<T> : IEquatable<ObservableUpdate<T>>, IStructuralEquatable { public static class Tags { public const int Next = 0; public const int Error = 1; public const int Completed = 2; } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(ObservableUpdate<>.Next@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] public class Next : ObservableUpdate<T> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T item; [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public T Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(ObservableUpdate<>))] [CompilerGenerated] [DebuggerNonUserCode] internal Next(T item) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(ObservableUpdate<>.Error@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] public class Error : ObservableUpdate<T> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly Exception item; [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public Exception Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(ObservableUpdate<>))] [CompilerGenerated] [DebuggerNonUserCode] internal Error(Exception item) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(ObservableUpdate<>._Completed@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] internal class _Completed : ObservableUpdate<T> { [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(ObservableUpdate<>))] [CompilerGenerated] [DebuggerNonUserCode] internal _Completed() { } } [SpecialName] internal class Next@DebugTypeProxy { [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public T Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(ObservableUpdate<>))] [CompilerGenerated] [DebuggerNonUserCode] public Next@DebugTypeProxy(Next obj) { _obj = obj; } } [SpecialName] internal class Error@DebugTypeProxy { [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public Exception Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(ObservableUpdate<>))] [CompilerGenerated] [DebuggerNonUserCode] public Error@DebugTypeProxy(Error obj) { _obj = obj; } } [SpecialName] internal class _Completed@DebugTypeProxy { [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(ObservableUpdate<>))] [CompilerGenerated] [DebuggerNonUserCode] public _Completed@DebugTypeProxy(_Completed obj) { _obj = obj; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public int Tag { [CompilerGenerated] [DebuggerNonUserCode] get { return (this is _Completed) ? 2 : ((this is Error) ? 1 : 0); } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsNext { [CompilerGenerated] [DebuggerNonUserCode] get { return this is Next; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsError { [CompilerGenerated] [DebuggerNonUserCode] get { return this is Error; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public static ObservableUpdate<T> Completed { [CompilationMapping(/*Could not decode attribute arguments.*/)] get { return _unique_Completed; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsCompleted { [CompilerGenerated] [DebuggerNonUserCode] get { return this is _Completed; } } static ObservableUpdate() { _unique_Completed = new _Completed(); } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicNestedTypes | DynamicallyAccessedMemberTypes.NonPublicNestedTypes | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(ObservableUpdate<>))] [CompilerGenerated] [DebuggerNonUserCode] internal ObservableUpdate() { } [CompilationMapping(/*Could not decode attribute arguments.*/)] public static ObservableUpdate<T> NewNext(T item) { return new Next(item); } [CompilationMapping(/*Could not decode attribute arguments.*/)] public static ObservableUpdate<T> NewError(Exception item) { return new Error(item); } [SpecialName] [CompilerGenerated] [DebuggerNonUserCode] internal object __DebugDisplay() { return ((FSharpFunc<ObservableUpdate<ObservableUpdate<T>>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<ObservableUpdate<T>, string>>((PrintfFormat<FSharpFunc<ObservableUpdate<T>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<ObservableUpdate<FSharpFunc<ObservableUpdate<T>, string>>, string>, Unit, string, string, string>("%+0.8A"))).Invoke((ObservableUpdate<ObservableUpdate<T>>)(object)this); } [CompilerGenerated] public override string ToString() { return ((FSharpFunc<ObservableUpdate<ObservableUpdate<T>>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<ObservableUpdate<T>, string>>((PrintfFormat<FSharpFunc<ObservableUpdate<T>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<ObservableUpdate<FSharpFunc<ObservableUpdate<T>, string>>, string>, Unit, string, string, ObservableUpdate<FSharpFunc<ObservableUpdate<T>, string>>>("%+A"))).Invoke((ObservableUpdate<ObservableUpdate<T>>)(object)this); } [CompilerGenerated] public virtual sealed int GetHashCode(IEqualityComparer comp) { if (this != null) { int num = 0; if (!(this is Next)) { if (this is Error) { Error error = (Error)this; num = 1; return -1640531527 + (HashCompare.GenericHashWithComparerIntrinsic<Exception>(comp, error.item) + ((num << 6) + (num >> 2))); } return (this is _Completed) ? 2 : ((this is Error) ? 1 : 0); } Next next = (Next)this; num = 0; T item = next.item; return -1640531527 + (HashCompare.GenericHashWithComparerIntrinsic<T>(comp, item) + ((num << 6) + (num >> 2))); } return 0; } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public virtual sealed bool Equals(object obj, IEqualityComparer comp) { if (this != null) { if (obj is ObservableUpdate<T> observableUpdate) { int num = ((this is _Completed) ? 2 : ((this is Error) ? 1 : 0)); ObservableUpdate<T> observableUpdate2 = observableUpdate; int num2 = ((observableUpdate2 is _Completed) ? 2 : ((observableUpdate2 is Error) ? 1 : 0)); if (num == num2) { if (!(this is Next)) { if (this is Error) { Error error = (Error)this; Error error2 = (Error)observableUpdate; return HashCompare.GenericEqualityWithComparerIntrinsic<Exception>(comp, error.item, error2.item); } return true; } Next next = (Next)this; Next next2 = (Next)observableUpdate; T item = next.item; T item2 = next2.item; return HashCompare.GenericEqualityWithComparerIntrinsic<T>(comp, item, item2); } return false; } return false; } return obj == null; } [CompilerGenerated] public virtual sealed bool Equals(ObservableUpdate<T> obj) { if (this != null) { if (obj != null) { int num = ((this is _Completed) ? 2 : ((this is Error) ? 1 : 0)); int num2 = ((obj is _Completed) ? 2 : ((obj is Error) ? 1 : 0)); if (num == num2) { if (!(this is Next)) { if (this is Error) { Error error = (Error)this; Error error2 = (Error)obj; return HashCompare.GenericEqualityERIntrinsic<Exception>(error.item, error2.item); } return true; } Next next = (Next)this; Next next2 = (Next)obj; T item = next.item; T item2 = next2.item; return HashCompare.GenericEqualityERIntrinsic<T>(item, item2); } return false; } return false; } return obj == null; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is ObservableUpdate<T> obj2) { return Equals(obj2); } return false; } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class ObservableExtensions { internal ObservableExtensions() { } public static IObservable<TItem> ToObservable<TItem>(this IEnumerable<TItem> source) { return Observable.ofSeq(source); } public static IDisposable Subscribe<TSource>(this IObservable<TSource> source, Action<TSource> action) { return CommonExtensions.SubscribeToObservable<TSource>(source, (FSharpFunc<TSource, Unit>)new $Observable.Subscribe@388<TSource>(action)); } public static IObservable<TSource> Where<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate) { return ObservableModule.Filter<TSource>((FSharpFunc<TSource, bool>)new $Observable.Where@392<TSource>(predicate), source); } public static IObservable<TResult> Select<TSource, TResult>(this IObservable<TSource> source, Func<TSource, TResult> selector) { return ObservableModule.Map<TSource, TResult>((FSharpFunc<TSource, TResult>)new $Observable.Select@396<TSource, TResult>(selector), source); } public static IObservable<TResult> Select<TSource, TResult>(this IObservable<TSource> source, Func<TSource, int, TResult> selector) { return Observable.mapi<TSource, TResult>((FSharpFunc<int, FSharpFunc<TSource, TResult>>)(object)new $Observable.Select@400-1<TSource, TResult>(selector), source); } public static IObservable<TResult> SelectMany<TSource, TCollection, TResult>(this IObservable<TSource> source, Func<TSource, IEnumerable<TCollection>> collectionSelector, Func<TSource, TCollection, TResult> resultSelector) { return new $Observable.SelectMany@407<TSource, TCollection, TResult>(source, collectionSelector, resultSelector); } public static IObservable<TSource> TakeWhile<TSource>(this IObservable<TSource> source, Func<TSource, bool> f) { return Observable.takeWhile(new $Observable.TakeWhile@421<TSource>(f), source); } public static IObservable<TSource> Merge<TSource>(this IObservable<TSource> source, IEnumerable<IObservable<TSource>> sources) { object @_instance; @_instance = $Observable.merge@426-1.@_instance; FSharpList<IObservable<TSource>> val = SeqModule.ToList<IObservable<TSource>>(sources); return (($Observable.merge@426-1)@_instance).DirectInvoke<TSource, IObservable<TSource>>().Invoke(source).Invoke(val); } public static IObservable<TSource> Merge<TSource>(this IObservable<TSource> source, params IObservable<TSource>[] sources) { return Merge(source, SeqModule.OfArray<IObservable<TSource>>(sources)); } public static IObservable<TAccumulate> Scan<TSource, TAccumulate>(this IObservable<TSource> source, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> f) { return ObservableModule.Scan<TAccumulate, TSource>((FSharpFunc<TAccumulate, FSharpFunc<TSource, TAccumulate>>)(object)new $Observable.Scan@439<TSource, TAccumulate>(f), seed, source); } public static IObservable<TResult> CombineLatest<TLeft, TRight, TResult>(this IObservable<TLeft> left, IObservable<TRight> right, Func<TLeft, TRight, TResult> selector) { return ObservableModule.Map<Tuple<TLeft, TRight>, TResult>((FSharpFunc<Tuple<TLeft, TRight>, TResult>)new $Observable.CombineLatest@444<TLeft, TRight, TResult>(selector), Observable.combineLatest(left, right)); } public static IObservable<TResult> Zip<TLeft, TRight, TResult>(this IObservable<TLeft> left, IObservable<TRight> right, Func<TLeft, TRight, TResult> selector) { return ObservableModule.Map<Tuple<TLeft, TRight>, TResult>((FSharpFunc<Tuple<TLeft, TRight>, TResult>)new $Observable.Zip@449<TLeft, TRight, TResult>(selector), Observable.zip(left, right)); } public static IObservable<TSource> Delay<TSource>(this IObservable<TSource> source, int milliseconds) { return Observable.delay(milliseconds, source); } public static IObservable<IEnumerable<TSource>> BufferWithTimeOrCount<TSource>(this IObservable<TSource> source, TimeSpan timeSpan, int count) { return Observable.bufferWithTimeOrCount(timeSpan, count, source); } public static IObservable<TSource> Throttle<TSource>(this IObservable<TSource> source, TimeSpan dueTime) { return Observable.throttle((int)dueTime.TotalMilliseconds, source); } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal class CircularBuffer<T> { internal int bufferSize; internal T[] buffer; internal int index; internal int total; public CircularBuffer(int bufferSize) { this.bufferSize = bufferSize; buffer = ArrayModule.ZeroCreate<T>(this.bufferSize); index = 0; total = 0; } internal void Add(T value) { if (bufferSize > 0) { buffer[index] = value; index = (index + 1) % bufferSize; int num = total + 1; int num2 = bufferSize; total = ((num >= num2) ? num2 : num); } } internal void Iter(FSharpFunc<T, Unit> f) { int num = ((total == bufferSize) ? index : 0); int num2 = 0; int num3 = total - 1; if (num3 >= num2) { do { f.Invoke(buffer[(num + num2) % bufferSize]); num2++; } while (num2 != num3 + 1); } } } [Serializable] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [DebuggerDisplay("{__DebugDisplay(),nq}")] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal class BufferAgentMessage<T> : IEquatable<BufferAgentMessage<T>>, IStructuralEquatable { internal static class Tags { public const int Add = 0; public const int Remove = 1; public const int Next = 2; public const int Completed = 3; public const int Error = 4; } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(BufferAgentMessage<>.Add@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] internal class Add : BufferAgentMessage<T> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly IObserver<T> item; [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] internal IObserver<T> Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(BufferAgentMessage<>))] [CompilerGenerated] [DebuggerNonUserCode] internal Add(IObserver<T> item) : base(0) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(BufferAgentMessage<>.Remove@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] internal class Remove : BufferAgentMessage<T> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly IObserver<T> item; [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] internal IObserver<T> Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(BufferAgentMessage<>))] [CompilerGenerated] [DebuggerNonUserCode] internal Remove(IObserver<T> item) : base(1) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(BufferAgentMessage<>.Next@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] internal class Next : BufferAgentMessage<T> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T item; [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] internal T Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(BufferAgentMessage<>))] [CompilerGenerated] [DebuggerNonUserCode] internal Next(T item) : base(2) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(BufferAgentMessage<>.Error@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] internal class Error : BufferAgentMessage<T> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly Exception item; [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] internal Exception Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(BufferAgentMessage<>))] [CompilerGenerated] [DebuggerNonUserCode] internal Error(Exception item) : base(4) { this.item = item; } } [SpecialName] internal class Add@DebugTypeProxy { [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public IObserver<T> Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(BufferAgentMessage<>))] [CompilerGenerated] [DebuggerNonUserCode] public Add@DebugTypeProxy(Add obj) { _obj = obj; } } [SpecialName] internal class Remove@DebugTypeProxy { [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public IObserver<T> Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(BufferAgentMessage<>))] [CompilerGenerated] [DebuggerNonUserCode] public Remove@DebugTypeProxy(Remove obj) { _obj = obj; } } [SpecialName] internal class Next@DebugTypeProxy { [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public T Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(BufferAgentMessage<>))] [CompilerGenerated] [DebuggerNonUserCode] public Next@DebugTypeProxy(Next obj) { _obj = obj; } } [SpecialName] internal class Error@DebugTypeProxy { [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public Exception Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(BufferAgentMessage<>))] [CompilerGenerated] [DebuggerNonUserCode] public Error@DebugTypeProxy(Error obj) { _obj = obj; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal int Tag { [DebuggerNonUserCode] get; } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool IsAdd { [CompilerGenerated] [DebuggerNonUserCode] get { return Tag == 0; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool IsRemove { [CompilerGenerated] [DebuggerNonUserCode] get { return Tag == 1; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool IsNext { [CompilerGenerated] [DebuggerNonUserCode] get { return Tag == 2; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal static BufferAgentMessage<T> Completed { [CompilationMapping(/*Could not decode attribute arguments.*/)] get { return _unique_Completed; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool IsCompleted { [CompilerGenerated] [DebuggerNonUserCode] get { return Tag == 3; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool IsError { [CompilerGenerated] [DebuggerNonUserCode] get { return Tag == 4; } } static BufferAgentMessage() { _unique_Completed = new BufferAgentMessage<T>(3); } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicNestedTypes | DynamicallyAccessedMemberTypes.NonPublicNestedTypes | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(BufferAgentMessage<>))] [CompilerGenerated] [DebuggerNonUserCode] internal BufferAgentMessage(int _tag) { this._tag = _tag; } [CompilationMapping(/*Could not decode attribute arguments.*/)] internal static BufferAgentMessage<T> NewAdd(IObserver<T> item) { return new Add(item); } [CompilationMapping(/*Could not decode attribute arguments.*/)] internal static BufferAgentMessage<T> NewRemove(IObserver<T> item) { return new Remove(item); } [CompilationMapping(/*Could not decode attribute arguments.*/)] internal static BufferAgentMessage<T> NewNext(T item) { return new Next(item); } [CompilationMapping(/*Could not decode attribute arguments.*/)] internal static BufferAgentMessage<T> NewError(Exception item) { return new Error(item); } [SpecialName] [CompilerGenerated] [DebuggerNonUserCode] internal object __DebugDisplay() { return ((FSharpFunc<BufferAgentMessage<BufferAgentMessage<T>>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<BufferAgentMessage<T>, string>>((PrintfFormat<FSharpFunc<BufferAgentMessage<T>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<BufferAgentMessage<FSharpFunc<BufferAgentMessage<T>, string>>, string>, Unit, string, string, string>("%+0.8A"))).Invoke((BufferAgentMessage<BufferAgentMessage<T>>)(object)this); } [CompilerGenerated] public override string ToString() { return ((FSharpFunc<BufferAgentMessage<BufferAgentMessage<T>>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<BufferAgentMessage<T>, string>>((PrintfFormat<FSharpFunc<BufferAgentMessage<T>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<BufferAgentMessage<FSharpFunc<BufferAgentMessage<T>, string>>, string>, Unit, string, string, BufferAgentMessage<FSharpFunc<BufferAgentMessage<T>, string>>>("%+A"))).Invoke((BufferAgentMessage<BufferAgentMessage<T>>)(object)this); } [CompilerGenerated] public virtual sealed int GetHashCode(IEqualityComparer comp) { if (this != null) { int num = 0; switch (Tag) { case 0: { Add add = (Add)this; num = 0; return -1640531527 + (HashCompare.GenericHashWithComparerIntrinsic<IObserver<T>>(comp, add.item) + ((num << 6) + (num >> 2))); } case 1: { Remove remove = (Remove)this; num = 1; return -1640531527 + (HashCompare.GenericHashWithComparerIntrinsic<IObserver<T>>(comp, remove.item) + ((num << 6) + (num >> 2))); } case 2: { Next next = (Next)this; num = 2; T item = next.item; return -1640531527 + (HashCompare.GenericHashWithComparerIntrinsic<T>(comp, item) + ((num << 6) + (num >> 2))); } case 4: { Error error = (Error)this; num = 4; return -1640531527 + (HashCompare.GenericHashWithComparerIntrinsic<Exception>(comp, error.item) + ((num << 6) + (num >> 2))); } default: return _tag; } } return 0; } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public virtual sealed bool Equals(object obj, IEqualityComparer comp) { if (this != null) { if (obj is BufferAgentMessage<T> bufferAgentMessage) { int tag = _tag; int tag2 = bufferAgentMessage._tag; if (tag == tag2) { switch (Tag) { case 0: { Add add = (Add)this; Add add2 = (Add)bufferAgentMessage; return HashCompare.GenericEqualityWithComparerIntrinsic<IObserver<T>>(comp, add.item, add2.item); } case 1: { Remove remove = (Remove)this; Remove remove2 = (Remove)bufferAgentMessage; return HashCompare.GenericEqualityWithComparerIntrinsic<IObserver<T>>(comp, remove.item, remove2.item); } case 2: { Next next = (Next)this; Next next2 = (Next)bufferAgentMessage; T item = next.item; T item2 = next2.item; return HashCompare.GenericEqualityWithComparerIntrinsic<T>(comp, item, item2); } case 4: { Error error = (Error)this; Error error2 = (Error)bufferAgentMessage; return HashCompare.GenericEqualityWithComparerIntrinsic<Exception>(comp, error.item, error2.item); } default: return true; } } return false; } return false; } return obj == null; } [CompilerGenerated] public virtual sealed bool Equals(BufferAgentMessage<T> obj) { if (this != null) { if (obj != null) { int tag = _tag; int tag2 = obj._tag; if (tag == tag2) { switch (Tag) { case 0: { Add add = (Add)this; Add add2 = (Add)obj; return HashCompare.GenericEqualityERIntrinsic<IObserver<T>>(add.item, add2.item); } case 1: { Remove remove = (Remove)this; Remove remove2 = (Remove)obj; return HashCompare.GenericEqualityERIntrinsic<IObserver<T>>(remove.item, remove2.item); } case 2: { Next next = (Next)this; Next next2 = (Next)obj; T item = next.item; T item2 = next2.item; return HashCompare.GenericEqualityERIntrinsic<T>(item, item2); } case 4: { Error error = (Error)this; Error error2 = (Error)obj; return HashCompare.GenericEqualityERIntrinsic<Exception>(error.item, error2.item); } default: return true; } } return false; } return false; } return obj == null; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is BufferAgentMessage<T> obj2) { return Equals(obj2); } return false; } } [Serializable] [Interface] [CompilationMapping(/*Could not decode attribute arguments.*/)] public interface ISubject<TIn, TOut> : IObservable<TOut>, IObserver<TIn> { } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class ReplaySubject<T> : ISubject<T, T> { internal FSharpMailboxProcessor<BufferAgentMessage<T>> agent; public ReplaySubject(int bufferSize) { agent = BufferAgent.start<T>((0 < bufferSize) ? bufferSize : 0); } public void OnNext(T value) { ((FSharpMailboxProcessor<BufferAgentMessage<BufferAgentMessage<T>>>)(object)agent).Post((BufferAgentMessage<BufferAgentMessage<T>>)(object)BufferAgentMessage<T>.NewNext(value)); } public void OnError(Exception error) { ((FSharpMailboxProcessor<BufferAgentMessage<BufferAgentMessage<T>>>)(object)agent).Post((BufferAgentMessage<BufferAgentMessage<T>>)(object)BufferAgentMessage<T>.NewError(error)); } public void OnCompleted() { ((FSharpMailboxProcessor<BufferAgentMessage<BufferAgentMessage<T>>>)(object)agent).Post((BufferAgentMessage<BufferAgentMessage<T>>)(object)BufferAgentMessage<T>.Completed); } public IDisposable Subscribe(IObserver<T> observer) { return subscribe(observer); } virtual void IObserver<T>.OnNext(T value) { ((FSharpMailboxProcessor<BufferAgentMessage<BufferAgentMessage<T>>>)(object)agent).Post((BufferAgentMessage<BufferAgentMessage<T>>)(object)BufferAgentMessage<T>.NewNext(value)); } virtual void IObserver<T>.OnError(Exception error) { ((FSharpMailboxProcessor<BufferAgentMessage<BufferAgentMessage<T>>>)(object)agent).Post((BufferAgentMessage<BufferAgentMessage<T>>)(object)BufferAgentMessage<T>.NewError(error)); } virtual void IObserver<T>.OnCompleted() { ((FSharpMailboxProcessor<BufferAgentMessage<BufferAgentMessage<T>>>)(object)agent).Post((BufferAgentMessage<BufferAgentMessage<T>>)(object)BufferAgentMessage<T>.Completed); } virtual IDisposable IObservable<T>.Subscribe(IObserver<T> observer) { return subscribe(observer); } [CompilerGenerated] internal IDisposable subscribe(IObserver<T> observer) { ((FSharpMailboxProcessor<BufferAgentMessage<BufferAgentMessage<T>>>)(object)agent).Post((BufferAgentMessage<BufferAgentMessage<T>>)(object)BufferAgentMessage<T>.NewAdd(observer)); return new $Observable.clo@527-1<T>(this, observer); } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class Subject<T> : ReplaySubject<T> { public Subject() : base(0) { } } [Serializable] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [NoEquality] [NoComparison] [DebuggerDisplay("{__DebugDisplay(),nq}")] [CompilationMapping(/*Could not decode attribute arguments.*/)] public abstract class AsyncResult<T> { public static class Tags { public const int AsyncOk = 0; public const int AsyncException = 1; public const int AsyncCanceled = 2; } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(AsyncResult<>.AsyncOk@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] public class AsyncOk : AsyncResult<T> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T item; [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public T Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(AsyncResult<>))] [CompilerGenerated] [DebuggerNonUserCode] internal AsyncOk(T item) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(AsyncResult<>.AsyncException@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] public class AsyncException : AsyncResult<T> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly Exception item; [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public Exception Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(AsyncResult<>))] [CompilerGenerated] [DebuggerNonUserCode] internal AsyncException(Exception item) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(AsyncResult<>.AsyncCanceled@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] public class AsyncCanceled : AsyncResult<T> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly OperationCanceledException item; [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public OperationCanceledException Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(AsyncResult<>))] [CompilerGenerated] [DebuggerNonUserCode] internal AsyncCanceled(OperationCanceledException item) { this.item = item; } } [SpecialName] internal class AsyncOk@DebugTypeProxy { [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public T Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(AsyncResult<>))] [CompilerGenerated] [DebuggerNonUserCode] public AsyncOk@DebugTypeProxy(AsyncOk obj) { _obj = obj; } } [SpecialName] internal class AsyncException@DebugTypeProxy { [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public Exception Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(AsyncResult<>))] [CompilerGenerated] [DebuggerNonUserCode] public AsyncException@DebugTypeProxy(AsyncException obj) { _obj = obj; } } [SpecialName] internal class AsyncCanceled@DebugTypeProxy { [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public OperationCanceledException Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(AsyncResult<>))] [CompilerGenerated] [DebuggerNonUserCode] public AsyncCanceled@DebugTypeProxy(AsyncCanceled obj) { _obj = obj; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public int Tag { [CompilerGenerated] [DebuggerNonUserCode] get { return (this is AsyncCanceled) ? 2 : ((this is AsyncException) ? 1 : 0); } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsAsyncOk { [CompilerGenerated] [DebuggerNonUserCode] get { return this is AsyncOk; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsAsyncException { [CompilerGenerated] [DebuggerNonUserCode] get { return this is AsyncException; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsAsyncCanceled { [CompilerGenerated] [DebuggerNonUserCode] get { return this is AsyncCanceled; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicNestedTypes | DynamicallyAccessedMemberTypes.NonPublicNestedTypes | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(AsyncResult<>))] [CompilerGenerated] [DebuggerNonUserCode] internal AsyncResult() { } [CompilationMapping(/*Could not decode attribute arguments.*/)] public static AsyncResult<T> NewAsyncOk(T item) { return new AsyncOk(item); } [CompilationMapping(/*Could not decode attribute arguments.*/)] public static AsyncResult<T> NewAsyncException(Exception item) { return new AsyncException(item); } [CompilationMapping(/*Could not decode attribute arguments.*/)] public static AsyncResult<T> NewAsyncCanceled(OperationCanceledException item) { return new AsyncCanceled(item); } [SpecialName] [CompilerGenerated] [DebuggerNonUserCode] internal object __DebugDisplay() { return ((FSharpFunc<AsyncResult<AsyncResult<T>>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<AsyncResult<T>, string>>((PrintfFormat<FSharpFunc<AsyncResult<T>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<AsyncResult<FSharpFunc<AsyncResult<T>, string>>, string>, Unit, string, string, string>("%+0.8A"))).Invoke((AsyncResult<AsyncResult<T>>)(object)this); } [CompilerGenerated] public override string ToString() { return ((FSharpFunc<AsyncResult<AsyncResult<T>>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<AsyncResult<T>, string>>((PrintfFormat<FSharpFunc<AsyncResult<T>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<AsyncResult<FSharpFunc<AsyncResult<T>, string>>, string>, Unit, string, string, AsyncResult<FSharpFunc<AsyncResult<T>, string>>>("%+A"))).Invoke((AsyncResult<AsyncResult<T>>)(object)this); } public static FSharpAsync<T> Commit(AsyncResult<T> res) { return FSharpAsync.FromContinuations<T>((FSharpFunc<Tuple<FSharpFunc<T, Unit>, FSharpFunc<Exception, Unit>, FSharpFunc<OperationCanceledException, Unit>>, Unit>)new $AsyncOperations.Commit@18<T>(res)); } } [Serializable] [Sealed] [CompilationMapping(/*Could not decode attribute arguments.*/)] public sealed class AsyncResultCell<T> { internal FSharpOption<AsyncResult<T>> result; internal FSharpList<FSharpFunc<AsyncResult<T>, Unit>> savedConts; internal object syncRoot; internal FSharpAsync<AsyncResult<T>> AsyncPrimitiveResult => FSharpAsync.FromContinuations<AsyncResult<T>>((FSharpFunc<Tuple<FSharpFunc<AsyncResult<T>, Unit>, FSharpFunc<Exception, Unit>, FSharpFunc<OperationCanceledException, Unit>>, Unit>)new $AsyncOperations.get_AsyncPrimitiveResult@63<T>(this)); public FSharpAsync<T> AsyncResult => ExtraTopLevelOperators.DefaultAsyncBuilder.Delay<T>((FSharpFunc<Unit, FSharpAsync<T>>)new $AsyncOperations.get_AsyncResult@81<T>(this)); public AsyncResultCell() { result = null; savedConts = FSharpList<FSharpFunc<AsyncResult<FSharpFunc<AsyncResult<T>, Unit>>, Unit>>.Empty; syncRoot = new object(); } public void RegisterResult(AsyncResult<T> res, [OptionalArgument] FSharpOption<bool> reuseThread) { FSharpList<FSharpFunc<AsyncResult<T>, Unit>> val; lock (syncRoot) { val = $AsyncOperations.action@1-2(this, res, null); } FSharpList<FSharpFunc<AsyncResult<T>, Unit>> val2 = val; bool flag = Operators.DefaultArg<bool>(reuseThread, false); if (((FSharpList<FSharpFunc<AsyncResult<FSharpFunc<AsyncResult<T>, Unit>>, Unit>>)(object)val2).TailOrNull == null) { return; } val = val2; if (((FSharpList<FSharpFunc<AsyncResult<FSharpFunc<AsyncResult<T>, Unit>>, Unit>>)(object)((FSharpList<FSharpFunc<AsyncResult<FSharpFunc<AsyncResult<T>, Unit>>, Unit>>)(object)val).TailOrNull).TailOrNull == null) { if (flag) { FSharpFunc<AsyncResult<T>, Unit> headOrDefault = ((FSharpList<FSharpFunc<AsyncResult<FSharpFunc<AsyncResult<T>, Unit>>, Unit>>)(object)val).HeadOrDefault; ((FSharpFunc<AsyncResult<AsyncResult<T>>, Unit>)(object)headOrDefault).Invoke((AsyncResult<AsyncResult<T>>)(object)res); return; } FSharpList<FSharpFunc<AsyncResult<T>, Unit>> val3 = val2; } else { FSharpList<FSharpFunc<AsyncResult<T>, Unit>> val3 = val2; } SynchronizationContext current = SynchronizationContext.Current; ListModule.Iterate<FSharpFunc<AsyncResult<T>, Unit>>((FSharpFunc<FSharpFunc<AsyncResult<T>, Unit>, Unit>)((current != null) ? ((object)new $AsyncOperations.RegisterResult@58-2<T>(res, current)) : ((object)new $AsyncOperations.RegisterResult@57<T>(res))), val2); } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class AsyncWorker<T> { internal FSharpAsync<T> p; internal CancellationTokenSource cts; internal SynchronizationContext syncContext; internal FSharpEvent<T> completed; internal FSharpEvent<Exception> error; internal FSharpEvent<OperationCanceledException> canceled; internal FSharpEvent<int> progress; public IEvent<FSharpHandler<int>, int> ProgressChanged => progress.Publish; public IEvent<FSharpHandler<T>, T> Completed => completed.Publish; public IEvent<FSharpHandler<OperationCanceledException>, OperationCanceledException> Canceled => canceled.Publish; public IEvent<FSharpHandler<Exception>, Exception> Error => error.Publish; public AsyncWorker(FSharpAsync<T> p, [OptionalArgument] FSharpOption<CancellationToken> cancellationToken) { this.p = p; CancellationTokenSource cancellationTokenSource; if (cancellationToken == null) { cancellationTokenSource = new CancellationTokenSource(); } else { CancellationToken value = cancellationToken.Value; CancellationTokenSource cancellationTokenSource2 = new CancellationTokenSource(); cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(value, cancellationTokenSource2.Token); } cts = cancellationTokenSource; syncContext = null; completed = new FSharpEvent<T>(); error = new FSharpEvent<Exception>(); canceled = new FSharpEvent<OperationCanceledException>(); progress = new FSharpEvent<int>(); } public void ReportProgress(int progressPercentage) { raiseEventOnGuiThread(progress, progressPercentage); } public bool RunAsync() { if (syncContext != null) { throw new InvalidOperationException("The operation is already in progress. RunAsync can't be called twice"); } SynchronizationContext current = SynchronizationContext.Current; syncContext = ((current != null) ? current : new SynchronizationContext()); return ThreadPool.QueueUserWorkItem(new $AsyncWorker.RunAsync@55<T>(this).Invoke); } public void CancelAsync([OptionalArgument] FSharpOption<string> message) { cts.Cancel(); } [CompilationArgumentCounts(new int[] { 1, 1 })] [CompilerGenerated] internal void raiseEventOnGuiThread<b>(FSharpEvent<b> @event, b args) { syncContext.Post(new $AsyncWorker.clo@27-2<b>(@event, args).Invoke, null); } [CompilerGenerated] internal void doWork() { FSharpAsync.StartWithContinuations<T>(p, (FSharpFunc<T, Unit>)new $AsyncWorker.clo@38-3<T>(this), (FSharpFunc<Exception, Unit>)new $AsyncWorker.clo@39-4<T>(this), (FSharpFunc<OperationCanceledException, Unit>)new $AsyncWorker.clo@40-5<T>(this), FSharpOption<CancellationToken>.Some(cts.Token)); } } [Serializable] [Sealed] [CompilationMapping(/*Could not decode attribute arguments.*/)] public sealed class AsyncStreamReader : IDisposable { internal static int defaultBufferSize; internal static int minBufferSize; internal Stream stream@47; internal Decoder decoder; internal Encoding encoding@49; internal int _maxCharsPerBuffer; internal byte[] byteBuffer; internal char[] charBuffer; internal byte[] preamble; internal int charPos; internal int charLen; internal int byteLen; internal int bytePos; internal bool _detectEncoding; internal bool _checkPreamble; internal static int init@16; public Encoding CurrentEncoding => encoding@49; public Stream BaseStream => stream@47; public FSharpAsync<bool> EndOfStream => ExtraTopLevelOperators.DefaultAsyncBuilder.Delay<bool>((FSharpFunc<Unit, FSharpAsync<bool>>)new $AsyncStreamReader.get_EndOfStream@290(this)); public AsyncStreamReader(Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks, int bufferSize) { if (HashCompare.GenericEqualityIntrinsic<Stream>(stream, (Stream)null) || HashCompare.GenericEqualityIntrinsic<Encoding>(encoding, (Encoding)null)) { throw new ArgumentNullException((!HashCompare.GenericEqualityIntrinsic<Stream>(stream, (Stream)null)) ? "encoding" : "stream"); } if (!stream.CanRead) { throw new ArgumentException("stream not readable", "stream"); } if (stream is FileStream fileStream && !fileStream.IsAsync) { FileStream fileStream2 = fileStream; throw new ArgumentException("FileStream not asynchronous. AsyncStreamReader should only be used on FileStream if the IsAsync property returns true. Consider passing 'true' for the async flag in the FileStream constructor", "stream"); } if (bufferSize <= 0) { ArgumentOutOfRangeException ex = new ArgumentOutOfRangeException("bufferSize"); throw ex; } stream@47 = stream; decoder = encoding.GetDecoder(); encoding@49 = encoding; if (init@16 < 6) { IntrinsicFunctions.FailStaticInit(); } int num = minBufferSize; int num2 = ((bufferSize >= num) ? bufferSize : num); _maxCharsPerBuffer = encoding@49.GetMaxCharCount(num2); byteBuffer = ArrayModule.ZeroCreate<byte>(num2); charBuffer = ArrayModule.ZeroCreate<char>(_maxCharsPerBuffer); preamble = encoding@49.GetPreamble(); charPos = 0; charLen = 0; byteLen = 0; bytePos = 0; _detectEncoding = detectEncodingFromByteOrderMarks; _checkPreamble = preamble.Length > 0; } public AsyncStreamReader(Stream stream) : this(stream, detectEncodingFromByteOrderMarks: true) { } public AsyncStreamReader(Stream stream, bool detectEncodingFromByteOrderMarks) { Encoding uTF = Encoding.UTF8; if (init@16 < 4) { IntrinsicFunctions.FailStaticInit(); } this..ctor(stream, uTF, detectEncodingFromByteOrderMarks, defaultBufferSize); } public AsyncStreamReader(Stream stream, Encoding encoding) { if (init@16 < 4) { IntrinsicFunctions.FailStaticInit(); } this..ctor(stream, encoding, detectEncodingFromByteOrderMarks: true, defaultBufferSize); } public AsyncStreamReader(Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks) { if (init@16 < 4) { IntrinsicFunctions.FailStaticInit(); } this..ctor(stream, encoding, detectEncodingFromByteOrderMarks, defaultBufferSize); } public void Close() { cleanup(); } public void DiscardBufferedData() { byteLen = 0; charLen = 0; charPos = 0; decoder = encoding@49.GetDecoder(); } public FSharpAsync<int> Peek() { return ExtraTopLevelOperators.DefaultAsyncBuilder.Delay<int>((FSharpFunc<Unit, FSharpAsync<int>>)new $AsyncStreamReader.Peek@302(this)); } public FSharpAsync<char> Read() { return ExtraTopLevelOperators.DefaultAsyncBuilder.Delay<char>((FSharpFunc<Unit, FSharpAsync<char>>)new $AsyncStreamReader.Read@307(this)); } public FSharpAsync<int> ReadExactly(char[] buffer, int index, int count) { return ExtraTopLevelOperators.DefaultAsyncBuilder.Delay<int>((FSharpFunc<Unit, FSharpAsync<int>>)new $AsyncStreamReader.ReadExactly@326(this, buffer, index, count)); } public FSharpAsync<int> Read(char[] buffer, int index, int count) { return ExtraTopLevelOperators.DefaultAsyncBuilder.Delay<int>((FSharpFunc<Unit, FSharpAsync<int>>)new $AsyncStreamReader.Read@339-9(this, buffer, index, count)); } public FSharpAsync<string> ReadToEnd() { return ExtraTopLevelOperators.DefaultAsyncBuilder.Delay<string>((FSharpFunc<Unit, FSharpAsync<string>>)new $AsyncStreamReader.ReadToEnd@367(this)); } public FSharpAsync<string> ReadLine() { return ExtraTopLevelOperators.DefaultAsyncBuilder.Delay<string>((FSharpFunc<Unit, FSharpAsync<string>>)new $AsyncStreamReader.ReadLine@394(this)); } virtual void IDisposable.Dispose() { cleanup(); } [CompilerGenerated] internal a readerClosed<a>() { throw new InvalidOperationException("reader closed"); } [CompilerGenerated] internal void compressBuffer(int n) { Buffer.BlockCopy(byteBuffer, n, byteBuffer, 0, byteLen - n); byteLen -= n; } [CompilerGenerated] internal bool isPreamble() { if (!_checkPreamble) { return _checkPreamble; } int num = ((byteLen < preamble.Length) ? (byteLen - bytePos) : (preamble.Length - bytePos)); bool flag = false; int num2 = 0; while (num2 < num && !flag) { if (byteBuffer[bytePos] != preamble[bytePos]) { bytePos = 0; _checkPreamble = false; flag = true; } if (!flag) { num2++; bytePos++; } } if (_checkPreamble && bytePos == preamble.Length) { compressBuffer(preamble.Length); bytePos = 0; _checkPreamble = false; _detectEncoding = false; } return _checkPreamble; } [CompilerGenerated] internal void detectEncoding() { if (byteLen < 2) { return; } _detectEncoding = false; bool flag = false; if (byteBuffer[0] == 254 && byteBuffer[1] == byte.MaxValue) { encoding@49 = new UnicodeEncoding(bigEndian: true, byteOrderMark: true); compressBuffer(2); flag = true; } else if (byteBuffer[0] == byte.MaxValue && byteBuffer[1] == 254) { if (byteLen >= 4 && byteBuffer[2] == 0 && byteBuffer[3] == 0) { encoding@49 = new UTF32Encoding(bigEndian: false, byteOrderMark: true); compressBuffer(4); } else { encoding@49 = new UnicodeEncoding(bigEndian: false, byteOrderMark: true); compressBuffer(2); } flag = true; } else if (byteLen >= 3 && byteBuffer[0] == 239 && byteBuffer[1] == 187 && byteBuffer[2] == 191) { encoding@49 = Encoding.UTF8; compressBuffer(3); flag = true; } else if (byteLen >= 4 && byteBuffer[0] == 0 && byteBuffer[1] == 0 && byteBuffer[2] == 254 && byteBuffer[3] == byte.MaxValue) { encoding@49 = new UTF32Encoding(bigEndian: true, byteOrderMark: true); flag = true; } else if (byteLen == 2) { _detectEncoding = true; } if (flag) { decoder = encoding@49.GetDecoder(); _maxCharsPerBuffer = encoding@49.GetMaxCharCount(byteBuffer.Length); charBuffer = ArrayModule.ZeroCreate<char>(_maxCharsPerBuffer); } } [CompilerGenerated] internal FSharpAsync<int> readBuffer() { return ExtraTopLevelOperators.DefaultAsyncBuilder.Delay<int>((FSharpFunc<Unit, FSharpAsync<int>>)new $AsyncStreamReader.clo@159-6(this)); } [CompilerGenerated] internal void cleanup() { try { Stream stream = stream@47; if (!HashCompare.GenericEqualityIntrinsic<Stream>(stream, (Stream)null)) { stream@47.Close(); } } finally { Stream stream = stream@47; if (!HashCompare.GenericEqualityIntrinsic<Stream>(stream, (Stream)null)) { stream@47 = null; encoding@49 = null; decoder = null; byteBuffer = null; charBuffer = null; charPos = 0; charLen = 0; } } } static AsyncStreamReader() { $AsyncStreamReader.init@ = 0; _ = $AsyncStreamReader.init@; } } [Serializable] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [DebuggerDisplay("{__DebugDisplay(),nq}")] [CompilationMapping(/*Could not decode attribute arguments.*/)] public sealed class AsyncStreamNode<a> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly a item1; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly FSharpAsync<AsyncStreamNode<a>> item2; [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public int Tag { [CompilerGenerated] [DebuggerNonUserCode] get { return 0; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public a Item1 { [CompilerGenerated] [DebuggerNonUserCode] get { return item1; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpAsync<AsyncStreamNode<a>> Item2 { [CompilerGenerated] [DebuggerNonUserCode] get { return item2; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public static AsyncStreamNode<a> NewASN(a item1, FSharpAsync<AsyncStreamNode<a>> item2) { return new AsyncStreamNode<a>(item1, item2); } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(AsyncStreamNode<>))] [CompilerGenerated] [DebuggerNonUserCode] internal AsyncStreamNode(a item1, FSharpAsync<AsyncStreamNode<a>> item2) { this.item1 = item1; this.item2 = item2; } [SpecialName] [CompilerGenerated] [DebuggerNonUserCode] internal object __DebugDisplay() { return ((FSharpFunc<AsyncStreamNode<AsyncStreamNode<a>>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<AsyncStreamNode<a>, string>>((PrintfFormat<FSharpFunc<AsyncStreamNode<a>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<AsyncStreamNode<FSharpFunc<AsyncStreamNode<a>, string>>, string>, Unit, string, string, string>("%+0.8A"))).Invoke((AsyncStreamNode<AsyncStreamNode<a>>)(object)this); } [CompilerGenerated] public override string ToString() { return ((FSharpFunc<AsyncStreamNode<AsyncStreamNode<a>>, string>)(object)ExtraTopLevelOperators.Pri
BepInEx/core/Mirage.Core/FSharpx.Collections.dll
Decompiled a month ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Runtime.Versioning; using System.Text; using System.Threading; using <StartupCode$FSharpx-Collections>; using FSharpx.Collections; using FSharpx.Collections.Mutable; using FSharpx.Collections.Tagged; using Microsoft.FSharp.Collections; using Microsoft.FSharp.Control; using Microsoft.FSharp.Core; using Microsoft.FSharp.Core.CompilerServices; using Microsoft.FSharp.Reflection; [assembly: FSharpInterfaceDataVersion(2, 0, 0)] [assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = "")] [assembly: AssemblyCompany("Steffen Forkmann, Daniel Mohl, Tomas Petricek, Ryan Riley, Mauricio Scheffer, Phil Trelford, JackFox")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCopyright("Copyright 2013-2021")] [assembly: AssemblyDescription("\r\n FSharpx.Collections is a collection of datastructures for use with F# and C#.\r\n ")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("FSharpx.Collections")] [assembly: AssemblyTitle("FSharpx.Collections")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/fsprojects/FSharpx.Collections")] [assembly: AssemblyTitle("FSharpx.Collections")] [assembly: AssemblyProduct("FSharpx.Collections")] [assembly: AssemblyDescription("FSharpx.Collections is a collection of datastructures for use with F# and C#.")] [assembly: InternalsVisibleTo("FSharpx.Collections.Tests")] [assembly: InternalsVisibleTo("FSharpx.Collections.Experimental.Tests")] [assembly: AssemblyFileVersion("3.1.0")] [assembly: AssemblyConfiguration("Release")] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyVersion("1.0.0.0")] namespace FSharpx.Collections { [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal class UndefinedException : Exception, IStructuralEquatable { internal UndefinedException() { } protected UndefinedException(SerializationInfo info, StreamingContext context) : base(info, context) { } [CompilerGenerated] public virtual int GetHashCode(IEqualityComparer comp) { if (this != null) { return 0; } return 0; } [CompilerGenerated] public override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public virtual bool Equals(object obj, IEqualityComparer comp) { if (this != null) { if (obj is Exception ex) { if (ex is UndefinedException) { return true; } return false; } return false; } return obj == null; } [CompilerGenerated] internal bool Equals(Exception obj) { if (this != null) { if (obj != null) { if (obj is UndefinedException) { return true; } return false; } return false; } return obj == null; } [CompilerGenerated] public override bool Equals(object obj) { if (obj is Exception obj2) { return Equals(obj2); } return false; } } [Serializable] [Sealed] [NoEquality] [NoComparison] [CompilationMapping(/*Could not decode attribute arguments.*/)] public sealed class LazyList<T> : IReadOnlyCollection<T>, IEnumerable, IEnumerable<T> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal Lazy<LazyListCell<T>> status@; [CompilationMapping(/*Could not decode attribute arguments.*/)] internal Lazy<LazyListCell<T>> status => status@; internal LazyListCell<T> Value => status@.Value; public bool IsEmpty { get { if (!(status@.Value is LazyListCell<T>._CellEmpty)) { return false; } return true; } } public T Head { get { LazyListCell<T> value = status@.Value; if (!(value is LazyListCell<T>._CellEmpty)) { return ((LazyListCell<T>.CellCons)value).item1; } throw new ArgumentException("the list is empty", "s"); } } public FSharpOption<T> TryHead { get { LazyListCell<T> value = status@.Value; if (!(value is LazyListCell<T>._CellEmpty)) { LazyListCell<T>.CellCons cellCons = (LazyListCell<T>.CellCons)value; return FSharpOption<T>.Some(cellCons.item1); } return null; } } public LazyList<T> Tail { get { LazyListCell<T> value = status@.Value; if (!(value is LazyListCell<T>._CellEmpty)) { return ((LazyListCell<T>.CellCons)value).item2; } throw new ArgumentException("the list is empty", "s"); } } public FSharpOption<LazyList<T>> TryTail { get { LazyListCell<T> value = status@.Value; if (!(value is LazyListCell<T>._CellEmpty)) { LazyListCell<T>.CellCons cellCons = (LazyListCell<T>.CellCons)value; return FSharpOption<LazyList<LazyList<T>>>.Some((LazyList<LazyList<T>>)(object)cellCons.item2); } return null; } } public Tuple<T, LazyList<T>> Uncons { get { LazyListCell<T> value = status@.Value; if (!(value is LazyListCell<T>._CellEmpty)) { LazyListCell<T>.CellCons cellCons = (LazyListCell<T>.CellCons)value; return new Tuple<T, LazyList<T>>(cellCons.item1, cellCons.item2); } throw new ArgumentException("the list does not contain head and tail", "x"); } } public FSharpOption<Tuple<T, LazyList<T>>> TryUncons { get { LazyListCell<T> value = status@.Value; if (!(value is LazyListCell<T>._CellEmpty)) { LazyListCell<T>.CellCons cellCons = (LazyListCell<T>.CellCons)value; LazyList<T> item = cellCons.item2; T item2 = cellCons.item1; return FSharpOption<Tuple<Tuple<T, LazyList<T>>, LazyList<Tuple<T, LazyList<T>>>>>.Some((Tuple<Tuple<T, LazyList<T>>, LazyList<Tuple<T, LazyList<T>>>>)(object)new Tuple<T, LazyList<T>>(item2, item)); } return null; } } internal LazyList(Lazy<LazyListCell<T>> status) { status@ = status; } [CompilerGenerated] public override string ToString() { return ((FSharpFunc<LazyList<LazyList<T>>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<LazyList<T>, string>>((PrintfFormat<FSharpFunc<LazyList<T>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<LazyList<FSharpFunc<LazyList<T>, string>>, string>, Unit, string, string, LazyList<FSharpFunc<LazyList<T>, string>>>("%+A"))).Invoke((LazyList<LazyList<T>>)(object)this); } internal static LazyListCell<T> getCell(LazyList<T> x) { return x.Value; } public int Length() { return $LazyList.lengthAux@41(0, this); } internal IEnumerator<T> GetEnumeratorImpl() { return $LazyList.toSeq@71(this).GetEnumerator(); } virtual IEnumerator<T> IEnumerable<T>.GetEnumerator() { return GetEnumeratorImpl(); } virtual IEnumerator IEnumerable.GetEnumerator() { return GetEnumeratorImpl(); } [SpecialName] virtual int IReadOnlyCollection<T>.get_Count() { return Length(); } } [Serializable] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [NoEquality] [NoComparison] [DebuggerDisplay("{__DebugDisplay(),nq}")] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal abstract class LazyListCell<T> { internal static class Tags { public const int CellCons = 0; public const int CellEmpty = 1; } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(LazyListCell<>.CellCons@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] internal class CellCons : LazyListCell<T> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T item1; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly LazyList<T> item2; [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] internal T Item1 { [CompilerGenerated] [DebuggerNonUserCode] get { return item1; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] internal LazyList<T> Item2 { [CompilerGenerated] [DebuggerNonUserCode] get { return item2; } } [CompilerGenerated] [DebuggerNonUserCode] internal CellCons(T item1, LazyList<T> item2) { this.item1 = item1; this.item2 = item2; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(LazyListCell<>._CellEmpty@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] internal class _CellEmpty : LazyListCell<T> { [CompilerGenerated] [DebuggerNonUserCode] internal _CellEmpty() { } } [SpecialName] internal class CellCons@DebugTypeProxy { [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public T Item1 { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item1; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public LazyList<T> Item2 { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item2; } } [CompilerGenerated] [DebuggerNonUserCode] public CellCons@DebugTypeProxy(CellCons obj) { _obj = obj; } } [SpecialName] internal class _CellEmpty@DebugTypeProxy { [CompilerGenerated] [DebuggerNonUserCode] public _CellEmpty@DebugTypeProxy(_CellEmpty obj) { _obj = obj; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal int Tag { [CompilerGenerated] [DebuggerNonUserCode] get { return (this is _CellEmpty) ? 1 : 0; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool IsCellCons { [CompilerGenerated] [DebuggerNonUserCode] get { return this is CellCons; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal static LazyListCell<T> CellEmpty { [CompilationMapping(/*Could not decode attribute arguments.*/)] get { return _unique_CellEmpty; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool IsCellEmpty { [CompilerGenerated] [DebuggerNonUserCode] get { return this is _CellEmpty; } } static LazyListCell() { _unique_CellEmpty = new _CellEmpty(); } [CompilerGenerated] [DebuggerNonUserCode] internal LazyListCell() { } [CompilationMapping(/*Could not decode attribute arguments.*/)] internal static LazyListCell<T> NewCellCons(T item1, LazyList<T> item2) { return new CellCons(item1, item2); } [SpecialName] [CompilerGenerated] [DebuggerNonUserCode] internal object __DebugDisplay() { return ((FSharpFunc<LazyListCell<LazyListCell<T>>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<LazyListCell<T>, string>>((PrintfFormat<FSharpFunc<LazyListCell<T>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<LazyListCell<FSharpFunc<LazyListCell<T>, string>>, string>, Unit, string, string, string>("%+0.8A"))).Invoke((LazyListCell<LazyListCell<T>>)(object)this); } [CompilerGenerated] public override string ToString() { return ((FSharpFunc<LazyListCell<LazyListCell<T>>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<LazyListCell<T>, string>>((PrintfFormat<FSharpFunc<LazyListCell<T>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<LazyListCell<FSharpFunc<LazyListCell<T>, string>>, string>, Unit, string, string, LazyListCell<FSharpFunc<LazyListCell<T>, string>>>("%+A"))).Invoke((LazyListCell<LazyListCell<T>>)(object)this); } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class ExtraIDictionary { public static FSharpOption<v> TryFind<k, v>(this IDictionary<k, v> d, k k) { v value = default(v); if (d.TryGetValue(k, out value)) { return FSharpOption<v>.Some(value); } return null; } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class ExtraIReadOnlyDictionary { public static FSharpOption<v> TryFind<k, v>(this IReadOnlyDictionary<k, v> d, k k) { v value = default(v); if (d.TryGetValue(k, out value)) { return FSharpOption<v>.Some(value); } return null; } } [Serializable] [Class] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class Deque<T> : IReadOnlyCollection<T>, IEnumerable, IEnumerable<T>, IEquatable<Deque<T>> { internal FSharpList<T> rBack@9; internal FSharpList<T> front@9; internal FSharpOption<int> hashCode; internal FSharpList<T> front => front@9; internal FSharpList<T> rBack => rBack@9; public T Head { get { FSharpList<T> val = front@9; FSharpList<T> val2 = rBack@9; if (val.TailOrNull == null) { if (val2.TailOrNull == null) { throw new Exception("Deque is empty"); } return ListModule.Head<T>(ListModule.Reverse<T>(val2)); } return val.HeadOrDefault; } } public FSharpOption<T> TryHead { get { FSharpList<T> val = front@9; FSharpList<T> val2 = rBack@9; if (val.TailOrNull == null) { if (val2.TailOrNull == null) { return null; } return FSharpOption<T>.Some(ListModule.Head<T>(ListModule.Reverse<T>(val2))); } FSharpList<T> val3 = val; return FSharpOption<T>.Some(val3.HeadOrDefault); } } public Deque<T> Initial { get { FSharpList<T> val = front@9; FSharpList<T> val2 = rBack@9; FSharpList<T> val4; if (val.TailOrNull == null) { if (val2.TailOrNull == null) { throw new Exception("Deque is empty"); } FSharpList<T> val3 = val2; val4 = val3.TailOrNull; T headOrDefault = val3.HeadOrDefault; } else { if (val2.TailOrNull == null) { int num = front@9.Length / 2; T[] sourceArray = ArrayModule.OfList<T>(front@9); T[] array = ArrayModule.Create<T>(num, front@9.Head); T[] array2 = ArrayModule.Create<T>(front@9.Length - num - 1, front@9.Head); int length = array.Length; System.Array.Copy(sourceArray, 0, array, 0, length); length = array.Length; int length2 = array2.Length; System.Array.Copy(sourceArray, length, array2, 0, length2); T[] array3 = ArrayModule.Reverse<T>(array2); return new Deque<T>(ListModule.OfArray<T>(array), ListModule.OfArray<T>(array3)); } FSharpList<T> val3 = val2; FSharpList<T> tailOrNull = val3.TailOrNull; T headOrDefault = val3.HeadOrDefault; val4 = tailOrNull; } return new Deque<T>(front@9, val4); } } public FSharpOption<Deque<T>> TryInitial { get { FSharpList<T> val = front@9; FSharpList<T> val2 = rBack@9; FSharpList<T> val4; if (val.TailOrNull == null) { if (val2.TailOrNull == null) { return null; } FSharpList<T> val3 = val2; val4 = val3.TailOrNull; T headOrDefault = val3.HeadOrDefault; } else { if (val2.TailOrNull == null) { int num = front@9.Length / 2; T[] sourceArray = ArrayModule.OfList<T>(front@9); T[] array = ArrayModule.Create<T>(num, front@9.Head); T[] array2 = ArrayModule.Create<T>(front@9.Length - num - 1, front@9.Head); int length = array.Length; System.Array.Copy(sourceArray, 0, array, 0, length); length = array.Length; int length2 = array2.Length; System.Array.Copy(sourceArray, length, array2, 0, length2); T[] array3 = ArrayModule.Reverse<T>(array2); return FSharpOption<Deque<Deque<T>>>.Some((Deque<Deque<T>>)(object)new Deque<T>(ListModule.OfArray<T>(array), ListModule.OfArray<T>(array3))); } FSharpList<T> val3 = val2; FSharpList<T> tailOrNull = val3.TailOrNull; T headOrDefault = val3.HeadOrDefault; val4 = tailOrNull; } return FSharpOption<Deque<Deque<T>>>.Some((Deque<Deque<T>>)(object)new Deque<T>(front@9, val4)); } } public bool IsEmpty { get { FSharpList<T> val = front@9; FSharpList<T> val2 = rBack@9; if (val.TailOrNull == null && val2.TailOrNull == null) { return true; } return false; } } public T Last { get { FSharpList<T> val = front@9; FSharpList<T> val2 = rBack@9; T headOrDefault; if (val.TailOrNull == null) { if (val2.TailOrNull == null) { throw new Exception("Deque is empty"); } FSharpList<T> val3 = val2; FSharpList<T> tailOrNull = val3.TailOrNull; headOrDefault = val3.HeadOrDefault; } else { if (val2.TailOrNull == null) { return ListModule.Head<T>(ListModule.Reverse<T>(val)); } FSharpList<T> val3 = val2; FSharpList<T> tailOrNull2 = val3.TailOrNull; headOrDefault = val3.HeadOrDefault; FSharpList<T> tailOrNull = tailOrNull2; } return headOrDefault; } } public FSharpOption<T> TryLast { get { FSharpList<T> val = front@9; FSharpList<T> val2 = rBack@9; T headOrDefault; if (val.TailOrNull == null) { if (val2.TailOrNull == null) { return null; } FSharpList<T> val3 = val2; FSharpList<T> tailOrNull = val3.TailOrNull; headOrDefault = val3.HeadOrDefault; } else { if (val2.TailOrNull == null) { return FSharpOption<T>.Some(ListModule.Head<T>(ListModule.Reverse<T>(val))); } FSharpList<T> val3 = val2; FSharpList<T> tailOrNull2 = val3.TailOrNull; headOrDefault = val3.HeadOrDefault; FSharpList<T> tailOrNull = tailOrNull2; } return FSharpOption<T>.Some(headOrDefault); } } public int Length => front@9.Length + rBack@9.Length; public Deque<T> Rev => new Deque<T>(rBack@9, front@9); public Deque<T> Tail { get { FSharpList<T> val = front@9; FSharpList<T> val2 = rBack@9; if (val.TailOrNull != null) { FSharpList<T> val3 = val; FSharpList<T> tailOrNull = val3.TailOrNull; T headOrDefault = val3.HeadOrDefault; return new Deque<T>(tailOrNull, rBack@9); } if (val2.TailOrNull != null) { FSharpList<T> val3 = val2; if (val3.TailOrNull.TailOrNull == null) { return new Deque<T>(FSharpList<T>.Empty, FSharpList<T>.Empty); } T[] array = ArrayModule.OfList<T>(rBack@9); int num = array.Length / 2; T[] array2 = ArrayModule.Create<T>(num, default(T)); T[] array3 = ArrayModule.Create<T>(array.Length - num - 1, default(T)); int length = array3.Length; System.Array.Copy(array, 0, array3, 0, length); length = array3.Length; int length2 = array2.Length; System.Array.Copy(array, length, array2, 0, length2); T[] array4 = ArrayModule.Reverse<T>(array2); return new Deque<T>(ListModule.OfArray<T>(array4), ListModule.OfArray<T>(array3)); } throw new Exception("Deque is empty"); } } public FSharpOption<Deque<T>> TryTail { get { FSharpList<T> val = front@9; FSharpList<T> val2 = rBack@9; if (val.TailOrNull == null) { if (val2.TailOrNull == null) { return null; } int num = rBack@9.Length / 2; T[] sourceArray = ArrayModule.OfList<T>(rBack@9); T[] array = ArrayModule.Create<T>(num, rBack@9.Head); T[] array2 = ArrayModule.Create<T>(rBack@9.Length - num - 1, rBack@9.Head); int length = array2.Length; System.Array.Copy(sourceArray, 0, array2, 0, length); length = array2.Length; int length2 = array.Length; System.Array.Copy(sourceArray, length, array, 0, length2); T[] array3 = ArrayModule.Reverse<T>(array); return FSharpOption<Deque<Deque<T>>>.Some((Deque<Deque<T>>)(object)new Deque<T>(ListModule.OfArray<T>(array3), ListModule.OfArray<T>(array2))); } FSharpList<T> val3 = val; FSharpList<T> tailOrNull = val3.TailOrNull; return FSharpOption<Deque<Deque<T>>>.Some((Deque<Deque<T>>)(object)new Deque<T>(tailOrNull, rBack@9)); } } public Tuple<T, Deque<T>> Uncons { get { FSharpList<T> val = front@9; FSharpList<T> val2 = rBack@9; if (val.TailOrNull == null && val2.TailOrNull == null) { throw new Exception("Deque is empty"); } return new Tuple<T, Deque<T>>(Head, Tail); } } public FSharpOption<Tuple<T, Deque<T>>> TryUncons { get { FSharpList<T> val = front@9; FSharpList<T> val2 = rBack@9; if (val.TailOrNull == null && val2.TailOrNull == null) { return null; } return FSharpOption<Tuple<Tuple<T, Deque<T>>, Deque<Tuple<T, Deque<T>>>>>.Some((Tuple<Tuple<T, Deque<T>>, Deque<Tuple<T, Deque<T>>>>)(object)new Tuple<T, Deque<T>>(Head, Tail)); } } public Tuple<Deque<T>, T> Unconj { get { FSharpList<T> val = front@9; FSharpList<T> val2 = rBack@9; if (val.TailOrNull == null && val2.TailOrNull == null) { throw new Exception("Deque is empty"); } return new Tuple<Deque<T>, T>(Initial, Last); } } public FSharpOption<Tuple<Deque<T>, T>> TryUnconj { get { FSharpList<T> val = front@9; FSharpList<T> val2 = rBack@9; if (val.TailOrNull == null && val2.TailOrNull == null) { return null; } return FSharpOption<Tuple<Deque<Tuple<Deque<T>, T>>, Tuple<Deque<T>, T>>>.Some((Tuple<Deque<Tuple<Deque<T>, T>>, Tuple<Deque<T>, T>>)(object)new Tuple<Deque<T>, T>(Initial, Last)); } } internal Deque(FSharpList<T> front, FSharpList<T> rBack) { front@9 = front; rBack@9 = rBack; hashCode = null; } public override int GetHashCode() { FSharpOption<int> val = hashCode; if (val == null) { int num = 1; foreach (T item in (IEnumerable<T>)this) { num = 31 * num + HashCompare.GenericHashIntrinsic<T>(item); } hashCode = FSharpOption<int>.Some(num); return num; } return val.Value; } public override bool Equals(object other) { if (other is Deque<T> deque) { Deque<T> other2 = deque; return ((IEquatable<Deque<T>>)this).Equals(other2); } return false; } public Deque<T> Conj(T x) { return new Deque<T>(front@9, FSharpList<T>.Cons(x, rBack@9)); } public Deque<T> Cons(T x) { return new Deque<T>(FSharpList<T>.Cons(x, front@9), rBack@9); } virtual bool IEquatable<Deque<T>>.Equals(Deque<T> y) { if (front@9.Length + rBack@9.Length != y.front@9.Length + y.rBack@9.Length) { return false; } if (GetHashCode() != y.GetHashCode()) { return false; } return SeqModule.ForAll2<T, T>((FSharpFunc<T, FSharpFunc<T, bool>>)(object)$Deque.System-IEquatable<FSharpx-Collections-Deque<'T>>-Equals@153<T>.@_instance, (IEnumerable<T>)this, (IEnumerable<T>)y); } virtual IEnumerator<T> IEnumerable<T>.GetEnumerator() { return ((IEnumerable<T>)(object)new $Deque.System-Collections-Generic-IEnumerable<'T>-GetEnumerator@158<T>(this, null, 0, default(T))).GetEnumerator(); } virtual IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable<T>)this).GetEnumerator(); } [SpecialName] virtual int IReadOnlyCollection<T>.get_Count() { return front@9.Length + rBack@9.Length; } } [Serializable] [Class] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class DList<T> : IReadOnlyCollection<T>, IEnumerable, IEnumerable<T>, IEquatable<DList<T>> { internal int length; internal DListData<T> data; internal FSharpOption<int> hashCode; internal DListData<T> dc => data; public int Length => length; public T Head => head(data); public FSharpOption<T> TryHead => tryHead(data); public bool IsEmpty { get { if (data is DListData<T>._Nil) { return true; } return false; } } public DList<T> Tail { get { if (data is DListData<T>._Nil) { throw new Exception("DList.tail: empty DList"); } return new DList<T>(length - 1, $DList.step@119(data, DListData<T>.Nil)); } } public FSharpOption<DList<T>> TryTail { get { if (data is DListData<T>._Nil) { return null; } return FSharpOption<DList<DList<T>>>.Some((DList<DList<T>>)(object)new DList<T>(length - 1, $DList.step@131-1(data, DListData<T>.Nil))); } } public Tuple<T, DList<T>> Uncons => new Tuple<T, DList<T>>(head(data), Tail); public FSharpOption<Tuple<T, DList<T>>> TryUncons { get { FSharpOption<T> val = tryHead(data); if (val != null) { FSharpOption<T> val2 = val; T value = val2.Value; return FSharpOption<Tuple<Tuple<T, DList<T>>, DList<Tuple<T, DList<T>>>>>.Some((Tuple<Tuple<T, DList<T>>, DList<Tuple<T, DList<T>>>>)(object)new Tuple<T, DList<T>>(value, Tail)); } return null; } } internal DList(int length, DListData<T> data) { this.length = length; this.data = data; hashCode = null; } internal static DList<T> ofSeq(IEnumerable<T> s) { return new DList<T>(SeqModule.Length<T>(s), SeqModule.Fold<T, DListData<T>>((FSharpFunc<DListData<T>, FSharpFunc<T, DListData<T>>>)(object)$DList.ofSeq@17-1<T>.@_instance, DListData<T>.Nil, s)); } public override int GetHashCode() { FSharpOption<int> val = hashCode; if (val == null) { int num = 1; foreach (T item in (IEnumerable<T>)this) { num = 31 * num + HashCompare.GenericHashIntrinsic<T>(item); } hashCode = FSharpOption<int>.Some(num); return num; } return val.Value; } public override bool Equals(object other) { if (other is DList<T> dList) { DList<T> other2 = dList; return ((IEquatable<DList<T>>)this).Equals(other2); } return false; } [CompilationArgumentCounts(new int[] { 1, 1, 1 })] internal static State foldBack<State>(FSharpFunc<T, FSharpFunc<State, State>> f, DList<T> l, State state) { return $DList.walk@50(f, FSharpList<DListData<DListData<T>>>.Empty, l.data, state); } [CompilationArgumentCounts(new int[] { 1, 1, 1 })] internal static State fold<State>(FSharpFunc<State, FSharpFunc<T, State>> f, State state, DList<T> l) { return $DList.walk@65-1(f, FSharpList<DListData<DListData<T>>>.Empty, l.data, state); } internal static DListData<a> append<a>(DListData<a> left, DListData<a> right) { if (left is DListData<a>._Nil) { return right; } if (right is DListData<a>._Nil) { return left; } return DListData<a>.NewJoin(left, right); } internal static DList<T> appendLists(DList<T> left, DList<T> right) { return new DList<T>(left.length + right.length, append(left.data, right.data)); } internal static a head<a>(DListData<a> data) { while (true) { DListData<a> dListData = data; if (!(dListData is DListData<a>.Unit)) { if (!(dListData is DListData<a>.Join)) { break; } DListData<a>.Join join = (DListData<a>.Join)data; data = join.item1; continue; } return ((DListData<a>.Unit)data).item; } throw new Exception("DList.head: empty DList"); } internal static FSharpOption<a> tryHead<a>(DListData<a> data) { while (true) { DListData<a> dListData = data; if (!(dListData is DListData<a>.Unit)) { if (!(dListData is DListData<a>.Join)) { break; } DListData<a>.Join join = (DListData<a>.Join)data; data = join.item1; continue; } DListData<a>.Unit unit = (DListData<a>.Unit)data; return FSharpOption<a>.Some(unit.item); } return null; } public DList<T> Cons(T hd) { if (data is DListData<T>._Nil) { return new DList<T>(1, DListData<T>.NewUnit(hd)); } return new DList<T>(length + 1, DListData<T>.NewJoin(DListData<T>.NewUnit(hd), data)); } public DList<T> Conj(T x) { return new DList<T>(length + 1, append(data, DListData<T>.NewUnit(x))); } internal IEnumerator<T> toSeq() { return $DList.walk@151-2(FSharpList<DListData<DListData<T>>>.Empty, data).GetEnumerator(); } virtual bool IEquatable<DList<T>>.Equals(DList<T> y) { if (length != y.length) { return false; } if (GetHashCode() != y.GetHashCode()) { return false; } return SeqModule.ForAll2<T, T>((FSharpFunc<T, FSharpFunc<T, bool>>)(object)$DList.System-IEquatable<FSharpx-Collections-DList<'T>>-Equals@172<T>.@_instance, (IEnumerable<T>)this, (IEnumerable<T>)y); } virtual IEnumerator<T> IEnumerable<T>.GetEnumerator() { return toSeq(); } virtual IEnumerator IEnumerable.GetEnumerator() { return toSeq(); } [SpecialName] virtual int IReadOnlyCollection<T>.get_Count() { return length; } } [Serializable] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [DebuggerDisplay("{__DebugDisplay(),nq}")] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal abstract class DListData<T> : IEquatable<DListData<T>>, IStructuralEquatable, IComparable<DListData<T>>, IComparable, IStructuralComparable { internal static class Tags { public const int Nil = 0; public const int Unit = 1; public const int Join = 2; } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(DListData<>._Nil@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] internal class _Nil : DListData<T> { [CompilerGenerated] [DebuggerNonUserCode] internal _Nil() { } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(DListData<>.Unit@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] internal class Unit : DListData<T> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T item; [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] internal T Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [CompilerGenerated] [DebuggerNonUserCode] internal Unit(T item) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(DListData<>.Join@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] internal class Join : DListData<T> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly DListData<T> item1; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly DListData<T> item2; [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] internal DListData<T> Item1 { [CompilerGenerated] [DebuggerNonUserCode] get { return item1; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] internal DListData<T> Item2 { [CompilerGenerated] [DebuggerNonUserCode] get { return item2; } } [CompilerGenerated] [DebuggerNonUserCode] internal Join(DListData<T> item1, DListData<T> item2) { this.item1 = item1; this.item2 = item2; } } [SpecialName] internal class _Nil@DebugTypeProxy { [CompilerGenerated] [DebuggerNonUserCode] public _Nil@DebugTypeProxy(_Nil obj) { _obj = obj; } } [SpecialName] internal class Unit@DebugTypeProxy { [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public T Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [CompilerGenerated] [DebuggerNonUserCode] public Unit@DebugTypeProxy(Unit obj) { _obj = obj; } } [SpecialName] internal class Join@DebugTypeProxy { [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public DListData<T> Item1 { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item1; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public DListData<T> Item2 { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item2; } } [CompilerGenerated] [DebuggerNonUserCode] public Join@DebugTypeProxy(Join obj) { _obj = obj; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal int Tag { [CompilerGenerated] [DebuggerNonUserCode] get { return (this is Join) ? 2 : ((this is Unit) ? 1 : 0); } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal static DListData<T> Nil { [CompilationMapping(/*Could not decode attribute arguments.*/)] get { return _unique_Nil; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool IsNil { [CompilerGenerated] [DebuggerNonUserCode] get { return this is _Nil; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool IsUnit { [CompilerGenerated] [DebuggerNonUserCode] get { return this is Unit; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool IsJoin { [CompilerGenerated] [DebuggerNonUserCode] get { return this is Join; } } static DListData() { _unique_Nil = new _Nil(); } [CompilerGenerated] [DebuggerNonUserCode] internal DListData() { } [CompilationMapping(/*Could not decode attribute arguments.*/)] internal static DListData<T> NewUnit(T item) { return new Unit(item); } [CompilationMapping(/*Could not decode attribute arguments.*/)] internal static DListData<T> NewJoin(DListData<T> item1, DListData<T> item2) { return new Join(item1, item2); } [SpecialName] [CompilerGenerated] [DebuggerNonUserCode] internal object __DebugDisplay() { return ((FSharpFunc<DListData<DListData<T>>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<DListData<T>, string>>((PrintfFormat<FSharpFunc<DListData<T>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<DListData<FSharpFunc<DListData<T>, string>>, string>, Unit, string, string, string>("%+0.8A"))).Invoke((DListData<DListData<T>>)(object)this); } [CompilerGenerated] public override string ToString() { return ((FSharpFunc<DListData<DListData<T>>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<DListData<T>, string>>((PrintfFormat<FSharpFunc<DListData<T>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<DListData<FSharpFunc<DListData<T>, string>>, string>, Unit, string, string, DListData<FSharpFunc<DListData<T>, string>>>("%+A"))).Invoke((DListData<DListData<T>>)(object)this); } [CompilerGenerated] public virtual sealed int CompareTo(DListData<T> obj) { if (this != null) { if (obj != null) { DListData<T> dListData = this; int num = ((dListData is Join) ? 2 : ((dListData is Unit) ? 1 : 0)); DListData<T> dListData2 = obj; int num2 = ((dListData2 is Join) ? 2 : ((dListData2 is Unit) ? 1 : 0)); if (num == num2) { IComparer genericComparer; if (!(this is Unit)) { if (this is Join) { Join join = (Join)this; Join join2 = (Join)obj; genericComparer = LanguagePrimitives.GenericComparer; dListData = join.item1; dListData2 = join2.item1; int num3 = dListData.CompareTo(dListData2, genericComparer); if (num3 < 0) { return num3; } if (num3 > 0) { return num3; } genericComparer = LanguagePrimitives.GenericComparer; dListData = join.item2; dListData2 = join2.item2; return dListData.CompareTo(dListData2, genericComparer); } return 0; } Unit unit = (Unit)this; Unit unit2 = (Unit)obj; genericComparer = LanguagePrimitives.GenericComparer; T item = unit.item; T item2 = unit2.item; return HashCompare.GenericComparisonWithComparerIntrinsic<T>(genericComparer, item, item2); } return num - num2; } return 1; } if (obj != null) { return -1; } return 0; } [CompilerGenerated] public virtual sealed int CompareTo(object obj) { return CompareTo((DListData<T>)obj); } [CompilerGenerated] public virtual sealed int CompareTo(object obj, IComparer comp) { while (true) { DListData<T> dListData = (DListData<T>)obj; if (this == null) { break; } if ((DListData<T>)obj != null) { DListData<T> dListData2 = this; int num = ((dListData2 is Join) ? 2 : ((dListData2 is Unit) ? 1 : 0)); DListData<T> dListData3 = dListData; int num2 = ((dListData3 is Join) ? 2 : ((dListData3 is Unit) ? 1 : 0)); if (num == num2) { DListData<T> dListData4 = this; if (!(dListData4 is Unit)) { if (dListData4 is Join) { Join join = (Join)this; Join join2 = (Join)dListData; dListData2 = join.item1; dListData3 = join2.item1; int num3 = dListData2.CompareTo(dListData3, comp); if (num3 < 0) { return num3; } if (num3 > 0) { return num3; } dListData2 = join.item2; dListData3 = join2.item2; DListData<T> dListData5 = dListData2; DListData<T> dListData6 = dListData3; comp = comp; obj = dListData6; this = dListData5; continue; } return 0; } Unit unit = (Unit)this; Unit unit2 = (Unit)dListData; T item = unit.item; T item2 = unit2.item; return HashCompare.GenericComparisonWithComparerIntrinsic<T>(comp, item, item2); } return num - num2; } return 1; } if ((DListData<T>)obj != null) { return -1; } return 0; } [CompilerGenerated] public virtual sealed int GetHashCode(IEqualityComparer comp) { if (this != null) { int num = 0; if (!(this is Unit)) { if (this is Join) { Join join = (Join)this; num = 2; num = -1640531527 + (join.item2.GetHashCode(comp) + ((num << 6) + (num >> 2))); return -1640531527 + (join.item1.GetHashCode(comp) + ((num << 6) + (num >> 2))); } return (this is Join) ? 2 : ((this is Unit) ? 1 : 0); } Unit unit = (Unit)this; num = 1; T item = unit.item; return -1640531527 + (HashCompare.GenericHashWithComparerIntrinsic<T>(comp, item) + ((num << 6) + (num >> 2))); } return 0; } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public virtual sealed bool Equals(object obj, IEqualityComparer comp) { while (this != null) { if (obj is DListData<T> dListData) { DListData<T> dListData2 = this; int num = ((dListData2 is Join) ? 2 : ((dListData2 is Unit) ? 1 : 0)); DListData<T> dListData3 = dListData; int num2 = ((dListData3 is Join) ? 2 : ((dListData3 is Unit) ? 1 : 0)); if (num == num2) { DListData<T> dListData4 = this; if (!(dListData4 is Unit)) { if (dListData4 is Join) { Join join = (Join)this; Join join2 = (Join)dListData; dListData2 = join.item1; dListData3 = join2.item1; if (dListData2.Equals(dListData3, comp)) { dListData2 = join.item2; dListData3 = join2.item2; DListData<T> dListData5 = dListData2; DListData<T> dListData6 = dListData3; comp = comp; obj = dListData6; this = dListData5; continue; } return false; } return true; } Unit unit = (Unit)this; Unit unit2 = (Unit)dListData; T item = unit.item; T item2 = unit2.item; return HashCompare.GenericEqualityWithComparerIntrinsic<T>(comp, item, item2); } return false; } return false; } return obj == null; } [CompilerGenerated] public virtual sealed bool Equals(DListData<T> obj) { while (this != null) { if (obj != null) { DListData<T> dListData = this; int num = ((dListData is Join) ? 2 : ((dListData is Unit) ? 1 : 0)); DListData<T> dListData2 = obj; int num2 = ((dListData2 is Join) ? 2 : ((dListData2 is Unit) ? 1 : 0)); if (num == num2) { DListData<T> dListData3 = this; if (!(dListData3 is Unit)) { if (dListData3 is Join) { Join join = (Join)this; Join join2 = (Join)obj; if (join.item1.Equals(join2.item1)) { DListData<T> item = join.item2; obj = join2.item2; this = item; continue; } return false; } return true; } Unit unit = (Unit)this; Unit unit2 = (Unit)obj; T item2 = unit.item; T item3 = unit2.item; return HashCompare.GenericEqualityERIntrinsic<T>(item2, item3); } return false; } return false; } return obj == null; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is DListData<T> obj2) { return Equals(obj2); } return false; } } [Serializable] [CustomEquality] [CustomComparison] [Serializable] [Struct] [CompilationMapping(/*Could not decode attribute arguments.*/)] public struct ByteString : IReadOnlyList<byte>, IEnumerable, IEnumerable<byte>, IComparable { internal byte[] array; internal int offset; internal int count; public byte[] Array => array; public int Offset => offset; public int Count => count; public byte this[int pos] => array[offset + pos]; public ByteString(byte[] array, int offset, int count) { this.array = array; this.offset = offset; this.count = count; } public ByteString(byte[] array) : this(array, 0, array.Length) { } public static int Compare(ByteString a, ByteString b) { byte[] array = a.array; int num = a.offset; int num2 = a.count; byte[] array2 = b.array; int num3 = b.offset; int num4 = b.count; if (array == array2 && num == num3) { if (num2 == num4) { return 0; } if (num2 < num4) { return -1; } return 1; } if (num2 < num4) { return -1; } if (num2 > num4) { return 1; } return $ByteString.Compare$cont@32(array, num, num2, array2, num3, num4, null); } public override bool Equals(object other) { if (other is ByteString b) { return Compare(this, b) == 0; } return false; } public override int GetHashCode() { byte[] array = this.array; int num = offset; int num2 = count; int num3 = HashCompare.GenericHashWithComparerIntrinsic<byte[]>(LanguagePrimitives.GenericEqualityERComparer, array); int num4 = ((num3 << 5) + num3) ^ num; return ((num4 << 5) + num4) ^ num2; } public IEnumerator<byte> GetEnumerator() { if (count == 0) { return new $ByteString.GetEnumerator@48(); } byte[] segment = array; int num = offset; int maxIndex = offset + count - 1; FSharpRef<int> currentIndex = new FSharpRef<int>(num - 1); return new $ByteString.GetEnumerator@63-1(segment, num, maxIndex, currentIndex); } virtual int IComparable.CompareTo(object other) { if (other is ByteString b) { return Compare(this, b); } throw new ArgumentException("Cannot compare a value of another type.", "other"); } virtual IEnumerator<byte> IEnumerable<byte>.GetEnumerator() { return GetEnumerator(); } virtual IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } [SpecialName] virtual byte IReadOnlyList<byte>.get_Item(int pos) { return array[offset + pos]; } [SpecialName] virtual int IReadOnlyCollection<byte>.get_Count() { return count; } } } namespace FSharpx.Collections.Mutable { [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class CircularBuffer<T> : IReadOnlyCollection<T>, IEnumerable, IEnumerable<T> { internal int bufferSize; internal T[] buffer; internal int head; internal int tail; internal int length; public int Count => length; public CircularBuffer(int bufferSize) { this.bufferSize = bufferSize; if (this.bufferSize <= 0) { throw new ArgumentException("The bufferSize must be greater than 0.", "bufferSize"); } buffer = ArrayModule.ZeroCreate<T>(this.bufferSize); head = this.bufferSize - 1; tail = 0; length = 0; } public T[] Dequeue(int count) { if (length == 0) { throw new InvalidOperationException("Queue exhausted."); } if (count > bufferSize) { ArgumentOutOfRangeException ex = new ArgumentOutOfRangeException("Requested count exceeds the buffer size."); throw ex; } int num = length; int num2 = ((count >= num) ? num : count); T[] result = ArrayModule.Concat<T>((IEnumerable<T[]>)SeqModule.ToArray<T[]>((IEnumerable<T[]>)(object)new $CircularBuffer.dequeued@43<T>(this, num2, null, 0, null))); tail = (tail + num2) % bufferSize; length -= num2; return result; } public void Enqueue(T[] value, int offset, int count) { if (count > bufferSize) { throw new InvalidOperationException("Requested count is too large."); } int num = offset; head = (head + 1) % bufferSize; IEnumerable<Tuple<int, int>> enumerable = nextBuffer(head, count); int item; int item2; int sourceIndex; foreach (Tuple<int, int> item3 in enumerable) { item = item3.Item2; item2 = item3.Item1; sourceIndex = num; T[] destinationArray = buffer; System.Array.Copy(value, sourceIndex, destinationArray, item2, item); num += item; } if (length == bufferSize) { tail = (tail + count) % bufferSize; return; } item = length + count - bufferSize; if (item > 0) { tail = (tail + item) % bufferSize; } item2 = length + count; sourceIndex = bufferSize; length = ((item2 >= sourceIndex) ? sourceIndex : item2); } public void Enqueue(T[] value) { Enqueue(value, 0, value.Length); } public void Enqueue(T[] value, int offset) { Enqueue(value, offset, value.Length - offset); } public void Enqueue(ArraySegment<T> value) { Enqueue(value.Array, value.Offset, value.Count); } public void Enqueue(T value) { Enqueue(new T[1] { value }, 0, 1); } public IEnumerator<T> GetEnumerator() { return $CircularBuffer.loop@86-19(this, null).GetEnumerator(); } virtual IEnumerator<T> IEnumerable<T>.GetEnumerator() { return ((IEnumerable<T>)this).GetEnumerator(); } virtual IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)this).GetEnumerator(); } [SpecialName] virtual int IReadOnlyCollection<T>.get_Count() { return length; } [CompilationArgumentCounts(new int[] { 1, 1 })] [CompilerGenerated] internal IEnumerable<Tuple<int, int>> nextBuffer(int offset, int count) { return (IEnumerable<Tuple<int, int>>)(object)new $CircularBuffer.clo@21<T>(this, offset, count, 0, 0, null); } } } namespace FSharpx.Collections { [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public interface IPriorityQueue<T> : IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable { bool IsEmpty { get; } int Length { get; } virtual IPriorityQueue<T> Insert(T P_0); virtual FSharpOption<T> TryPeek(); virtual T Peek(); virtual FSharpOption<Tuple<T, IPriorityQueue<T>>> TryPop(); virtual Tuple<T, IPriorityQueue<T>> Pop(); } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class Heap<T> : IPriorityQueue<T>, IEnumerable, IEnumerable<T>, IEquatable<Heap<T>> { internal int length; internal bool isDescending; internal HeapData<T> data; internal FSharpOption<int> hashCode; internal HeapData<T> heapData => data; internal int heapLength => length; public T Head { get { HeapData<T> heapData = data; if (!(heapData is HeapData<T>.T)) { throw new Exception("Heap is empty"); } return ((HeapData<T>.T)heapData).item1; } } public FSharpOption<T> TryHead { get { HeapData<T> heapData = data; if (!(heapData is HeapData<T>.T)) { return null; } HeapData<T>.T t = (HeapData<T>.T)heapData; return FSharpOption<T>.Some(t.item1); } } public bool IsEmpty { get { if (data is HeapData<T>._E) { return true; } return false; } } public bool IsDescending => isDescending; public int Length => length; public Heap(bool isDescending, int length, HeapData<T> data) { this.isDescending = isDescending; this.length = length; this.data = data; hashCode = null; } public override int GetHashCode() { FSharpOption<int> val = hashCode; if (val == null) { int num = 1; foreach (T item in (IEnumerable<T>)this) { num = 31 * num + HashCompare.GenericHashIntrinsic<T>(item); } hashCode = FSharpOption<int>.Some(num); return num; } return val.Value; } public override bool Equals(object other) { if (other is Heap<T> heap) { Heap<T> other2 = heap; return ((IEquatable<Heap<T>>)this).Equals(other2); } return false; } [CompilationArgumentCounts(new int[] { 1, 1, 1, 1 })] internal static Heap<T> merge(bool isDescending, int newLength, HeapData<T> h1, HeapData<T> h2) { HeapData<T> heapData; if (h1 is HeapData<T>.T) { HeapData<T>.T t = (HeapData<T>.T)h1; if (h2 is HeapData<T>.T) { HeapData<T>.T t2 = (HeapData<T>.T)h2; FSharpList<HeapData<T>> item = t2.item2; T item2 = t2.item1; FSharpList<HeapData<T>> item3 = t.item2; T item4 = t.item1; if (isDescending) { if (HashCompare.GenericLessOrEqualIntrinsic<T>(item4, item2)) { return new Heap<T>(isDescending, newLength, HeapData<T>.NewT(item2, FSharpList<HeapData<HeapData<T>>>.Cons((HeapData<HeapData<T>>)(object)h1, (FSharpList<HeapData<HeapData<T>>>)(object)item))); } return new Heap<T>(isDescending, newLength, HeapData<T>.NewT(item4, FSharpList<HeapData<HeapData<T>>>.Cons((HeapData<HeapData<T>>)(object)h2, (FSharpList<HeapData<HeapData<T>>>)(object)item3))); } if (HashCompare.GenericLessOrEqualIntrinsic<T>(item4, item2)) { return new Heap<T>(isDescending, newLength, HeapData<T>.NewT(item4, FSharpList<HeapData<HeapData<T>>>.Cons((HeapData<HeapData<T>>)(object)h2, (FSharpList<HeapData<HeapData<T>>>)(object)item3))); } return new Heap<T>(isDescending, newLength, HeapData<T>.NewT(item2, FSharpList<HeapData<HeapData<T>>>.Cons((HeapData<HeapData<T>>)(object)h1, (FSharpList<HeapData<HeapData<T>>>)(object)item))); } heapData = h1; return new Heap<T>(isDescending, newLength, heapData); } heapData = h2; return new Heap<T>(isDescending, newLength, heapData); } [CompilationArgumentCounts(new int[] { 1, 1, 1 })] internal static a foldHeap<a>(FSharpFunc<T, FSharpFunc<a, FSharpFunc<a, a>>> nodeF, a leafV, FSharpList<HeapData<T>> h) { return $PriorityQueue.loop@83-21<T, a, a>(nodeF, leafV, h, $PriorityQueue.foldHeap@88<a>.@_instance); } internal static FSharpList<T> inOrder(FSharpList<HeapData<T>> h) { return ((FSharpFunc<FSharpList<FSharpList<T>>, FSharpList<FSharpList<T>>>)(object)foldHeap<FSharpFunc<FSharpList<T>, FSharpList<T>>>((FSharpFunc<T, FSharpFunc<FSharpFunc<FSharpList<T>, FSharpList<T>>, FSharpFunc<FSharpFunc<FSharpList<T>, FSharpList<T>>, FSharpFunc<FSharpList<T>, FSharpList<T>>>>>)(object)$PriorityQueue.inOrder@91<T>.@_instance, (FSharpFunc<FSharpList<T>, FSharpList<T>>)$PriorityQueue.inOrder@91-1<T>.@_instance, h)).Invoke((FSharpList<FSharpList<T>>)(object)FSharpList<T>.Empty); } [CompilationArgumentCounts(new int[] { 1, 1 })] internal static Heap<T> ofSeq(bool isDescending, IEnumerable<T> s) { if (SeqModule.IsEmpty<T>(s)) { return new Heap<T>(isDescending, 0, HeapData<T>.E); } Tuple<int, HeapData<T>> tuple = SeqModule.Fold<T, Tuple<int, HeapData<T>>>((FSharpFunc<Tuple<int, HeapData<T>>, FSharpFunc<T, Tuple<int, HeapData<T>>>>)new $PriorityQueue.ofSeq@99-2<T>(isDescending), new Tuple<int, HeapData<T>>(0, HeapData<T>.E), s); int item = tuple.Item1; HeapData<T> item2 = tuple.Item2; return new Heap<T>(isDescending, item, item2); } public Heap<T> Insert(T x) { return merge(isDescending, length + 1, HeapData<T>.NewT(x, FSharpList<HeapData<HeapData<T>>>.Empty), data); } public Heap<T> Merge(Heap<T> xs) { if (isDescending == xs.isDescending) { return merge(isDescending, length + xs.length, data, xs.data); } throw new Exception("heaps to merge have different sort orders"); } public FSharpOption<Heap<T>> TryMerge(Heap<T> xs) { if (isDescending == xs.isDescending) { return FSharpOption<Heap<Heap<T>>>.Some((Heap<Heap<T>>)(object)merge(isDescending, length + xs.length, data, xs.data)); } return null; } public Heap<T> Rev() { if (isDescending) { return ofSeq(isDescending: false, this); } return ofSeq(isDescending: true, this); } public Heap<T> Tail() { FSharpFunc<HeapData<T>, FSharpFunc<HeapData<T>, HeapData<T>>> val = (FSharpFunc<HeapData<T>, FSharpFunc<HeapData<T>, HeapData<T>>>)(object)new $PriorityQueue.mergeData@169-1<T>(this); HeapData<T> heapData = data; if (!(heapData is HeapData<T>.T)) { throw new Exception("Heap is empty"); } HeapData<T>.T t = (HeapData<T>.T)heapData; FSharpList<HeapData<T>> item = t.item2; FSharpFunc<Tuple<FSharpOption<HeapData<T>>, FSharpList<HeapData<T>>>, FSharpFunc<HeapData<T>, Tuple<FSharpOption<HeapData<T>>, FSharpList<HeapData<T>>>>> val2 = (FSharpFunc<Tuple<FSharpOption<HeapData<T>>, FSharpList<HeapData<T>>>, FSharpFunc<HeapData<T>, Tuple<FSharpOption<HeapData<T>>, FSharpList<HeapData<T>>>>>)(object)new $PriorityQueue.combinePairs@185<T>(this); HeapData<T> e = HeapData<T>.E; Tuple<FSharpOption<HeapData<T>>, FSharpList<HeapData<T>>> tuple = ListModule.Fold<HeapData<T>, Tuple<FSharpOption<HeapData<T>>, FSharpList<HeapData<T>>>>(val2, new Tuple<FSharpOption<HeapData<T>>, FSharpList<HeapData<T>>>(null, FSharpList<HeapData<HeapData<T>>>.Empty), item); FSharpList<HeapData<T>> obj; if (tuple.Item1 != null) { FSharpOption<HeapData<T>> item2 = tuple.Item1; obj = FSharpList<HeapData<HeapData<T>>>.Cons((HeapData<HeapData<T>>)(object)((FSharpOption<HeapData<HeapData<T>>>)(object)item2).Value, (FSharpList<HeapData<HeapData<T>>>)(object)tuple.Item2); } else { obj = tuple.Item2; } HeapData<T> heapData2 = ListModule.Fold<HeapData<T>, HeapData<T>>(val, e, obj); return new Heap<T>(isDescending, length - 1, heapData2); } public FSharpOption<Heap<T>> TryTail() { if (data is HeapData<T>._E) { return null; } return FSharpOption<Heap<Heap<T>>>.Some((Heap<Heap<T>>)(object)Tail()); } public Tuple<T, Heap<T>> Uncons() { HeapData<T> heapData = data; if (!(heapData is HeapData<T>.T)) { throw new Exception("Heap is empty"); } HeapData<T>.T t = (HeapData<T>.T)heapData; return new Tuple<T, Heap<T>>(t.item1, Tail()); } public FSharpOption<Tuple<T, Heap<T>>> TryUncons() { HeapData<T> heapData = data; if (!(heapData is HeapData<T>.T)) { return null; } HeapData<T>.T t = (HeapData<T>.T)heapData; T item = t.item1; return FSharpOption<Tuple<Tuple<T, Heap<T>>, Heap<Tuple<T, Heap<T>>>>>.Some((Tuple<Tuple<T, Heap<T>>, Heap<Tuple<T, Heap<T>>>>)(object)new Tuple<T, Heap<T>>(item, Tail())); } virtual bool IEquatable<Heap<T>>.Equals(Heap<T> y) { if (length != y.length) { return false; } if (GetHashCode() != y.GetHashCode()) { return false; } return SeqModule.ForAll2<T, T>((FSharpFunc<T, FSharpFunc<T, bool>>)(object)$PriorityQueue.System-IEquatable<FSharpx-Collections-Heap<'T>>-Equals@222<T>.@_instance, (IEnumerable<T>)this, (IEnumerable<T>)y); } virtual IEnumerator<T> IEnumerable<T>.GetEnumerator() { FSharpList<HeapData<T>> h = FSharpList<HeapData<HeapData<T>>>.Cons((HeapData<HeapData<T>>)(object)data, (FSharpList<HeapData<HeapData<T>>>)(object)FSharpList<HeapData<HeapData<T>>>.Empty); return ((IEnumerable<T>)((!isDescending) ? ListModule.Sort<T>(inOrder(h)) : ListModule.Reverse<T>(ListModule.Sort<T>(inOrder(h))))).GetEnumerator(); } virtual IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable<T>)this).GetEnumerator(); } [SpecialName] virtual bool IPriorityQueue<T>.get_IsEmpty() { return data is HeapData<T>._E; } virtual IPriorityQueue<T> IPriorityQueue<T>.Insert(T element) { return Insert(element); } virtual FSharpOption<T> IPriorityQueue<T>.TryPeek() { return TryHead; } virtual T IPriorityQueue<T>.Peek() { return Head; } [SpecialName] virtual int IPriorityQueue<T>.get_Length() { return length; } [SpecialName] virtual int IReadOnlyCollection<T>.get_Count() { return length; } virtual FSharpOption<Tuple<T, IPriorityQueue<T>>> IPriorityQueue<T>.TryPop() { FSharpOption<Tuple<T, Heap<T>>> val = TryUncons(); if (val != null) { FSharpOption<Tuple<T, Heap<T>>> val2 = val; Heap<T> item = ((FSharpOption<Tuple<Tuple<T, Heap<T>>, Heap<Tuple<T, Heap<T>>>>>)(object)val2).Value.Item2; T item2 = ((FSharpOption<Tuple<Tuple<T, Heap<T>>, Heap<Tuple<T, Heap<T>>>>>)(object)val2).Value.Item1; return FSharpOption<Tuple<Tuple<T, IPriorityQueue<T>>, IPriorityQueue<Tuple<T, IPriorityQueue<T>>>>>.Some((Tuple<Tuple<T, IPriorityQueue<T>>, IPriorityQueue<Tuple<T, IPriorityQueue<T>>>>)(object)new Tuple<T, IPriorityQueue<T>>(item2, item)); } return null; } virtual Tuple<T, IPriorityQueue<T>> IPriorityQueue<T>.Pop() { Tuple<T, Heap<T>> tuple = Uncons(); Heap<T> item = tuple.Item2; return new Tuple<T, IPriorityQueue<T>>(tuple.Item1, item); } } [Serializable] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [DebuggerDisplay("{__DebugDisplay(),nq}")] [CompilationMapping(/*Could not decode attribute arguments.*/)] public abstract class HeapData<T> : IEquatable<HeapData<T>>, IStructuralEquatable, IComparable<HeapData<T>>, IComparable, IStructuralComparable { public static class Tags { public const int E = 0; public const int T = 1; } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(HeapData<>._E@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] internal class _E : HeapData<T> { [CompilerGenerated] [DebuggerNonUserCode] internal _E() { } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(HeapData<>.T@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] public class T : HeapData<T> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly T item1; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly FSharpList<HeapData<T>> item2; [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public T Item1 { [CompilerGenerated] [DebuggerNonUserCode] get { return item1; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpList<HeapData<T>> Item2 { [CompilerGenerated] [DebuggerNonUserCode] get { return item2; } } [CompilerGenerated] [DebuggerNonUserCode] internal T(T item1, FSharpList<HeapData<T>> item2) { this.item1 = item1; this.item2 = item2; } } [SpecialName] internal class _E@DebugTypeProxy { [CompilerGenerated] [DebuggerNonUserCode] public _E@DebugTypeProxy(_E obj) { _obj = obj; } } [SpecialName] internal class T@DebugTypeProxy { [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public T Item1 { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item1; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpList<HeapData<T>> Item2 { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item2; } } [CompilerGenerated] [DebuggerNonUserCode] public T@DebugTypeProxy(HeapData<T>.T obj) { _obj = obj; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public int Tag { [CompilerGenerated] [DebuggerNonUserCode] get { return (this is HeapData<T>.T) ? 1 : 0; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public static HeapData<T> E { [CompilationMapping(/*Could not decode attribute arguments.*/)] get { return _unique_E; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsE { [CompilerGenerated] [DebuggerNonUserCode] get { return this is _E; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsT { [CompilerGenerated] [DebuggerNonUserCode] get { return this is HeapData<T>.T; } } static HeapData() { _unique_E = new _E(); } [CompilerGenerated] [DebuggerNonUserCode] internal HeapData() { } [CompilationMapping(/*Could not decode attribute arguments.*/)] public static HeapData<T> NewT(T item1, FSharpList<HeapData<T>> item2) { return new HeapData<T>.T(item1, item2); } [SpecialName] [CompilerGenerated] [DebuggerNonUserCode] internal object __DebugDisplay() { return ((FSharpFunc<HeapData<HeapData<T>>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<HeapData<T>, string>>((PrintfFormat<FSharpFunc<HeapData<T>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<HeapData<FSharpFunc<HeapData<T>, string>>, string>, Unit, string, string, string>("%+0.8A"))).Invoke((HeapData<HeapData<T>>)(object)this); } [CompilerGenerated] public override string ToString() { return ((FSharpFunc<HeapData<HeapData<T>>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<HeapData<T>, string>>((PrintfFormat<FSharpFunc<HeapData<T>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<HeapData<FSharpFunc<HeapData<T>, string>>, string>, Unit, string, string, HeapData<FSharpFunc<HeapData<T>, string>>>("%+A"))).Invoke((HeapData<HeapData<T>>)(object)this); } [CompilerGenerated] public virtual sealed int CompareTo(HeapData<T> obj) { if (this != null) { if (obj != null) { int num = ((this is HeapData<T>.T) ? 1 : 0); int num2 = ((obj is HeapData<T>.T) ? 1 : 0); if (num == num2) { if (this is HeapData<T>.T) { HeapData<T>.T t = (HeapData<T>.T)this; HeapData<T>.T t2 = (HeapData<T>.T)obj; IComparer genericComparer = LanguagePrimitives.GenericComparer; T item = t.item1; T item2 = t2.item1; int num3 = HashCompare.GenericComparisonWithComparerIntrinsic<T>(genericComparer, item, item2); if (num3 < 0) { return num3; } if (num3 > 0) { return num3; } genericComparer = LanguagePrimitives.GenericComparer; FSharpList<HeapData<T>> item3 = t.item2; FSharpList<HeapData<T>> item4 = t2.item2; return ((FSharpList<HeapData<HeapData<T>>>)(object)item3).CompareTo((object)item4, genericComparer); } return 0; } return num - num2; } return 1; } if (obj != null) { return -1; } return 0; } [CompilerGenerated] public virtual sealed int CompareTo(object obj) { return CompareTo((HeapData<T>)obj); } [CompilerGenerated] public virtual sealed int CompareTo(object obj, IComparer comp) { HeapData<T> heapData = (HeapData<T>)obj; if (this != null) { if ((HeapData<T>)obj != null) { int num = ((this is HeapData<T>.T) ? 1 : 0); HeapData<T> heapData2 = heapData; int num2 = ((heapData2 is HeapData<T>.T) ? 1 : 0); if (num == num2) { if (this is HeapData<T>.T) { HeapData<T>.T t = (HeapData<T>.T)this; HeapData<T>.T t2 = (HeapData<T>.T)heapData; T item = t.item1; T item2 = t2.item1; int num3 = HashCompare.GenericComparisonWithComparerIntrinsic<T>(comp, item, item2); if (num3 < 0) { return num3; } if (num3 > 0) { return num3; } FSharpList<HeapData<T>> item3 = t.item2; FSharpList<HeapData<T>> item4 = t2.item2; return ((FSharpList<HeapData<HeapData<T>>>)(object)item3).CompareTo((object)item4, comp); } return 0; } return num - num2; } return 1; } if ((HeapData<T>)obj != null) { return -1; } return 0; } [CompilerGenerated] public virtual sealed int GetHashCode(IEqualityComparer comp) { if (this != null) { int num = 0; if (this is HeapData<T>.T) { HeapData<T>.T t = (HeapData<T>.T)this; num = 1; num = -1640531527 + (((FSharpList<HeapData<HeapData<T>>>)(object)t.item2).GetHashCode(comp) + ((num << 6) + (num >> 2))); T item = t.item1; return -1640531527 + (HashCompare.GenericHashWithComparerIntrinsic<T>(comp, item) + ((num << 6) + (num >> 2))); } return (this is HeapData<T>.T) ? 1 : 0; } return 0; } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public virtual sealed bool Equals(object obj, IEqualityComparer comp) { if (this != null) { if (obj is HeapData<T> heapData) { int num = ((this is HeapData<T>.T) ? 1 : 0); HeapData<T> heapData2 = heapData; int num2 = ((heapData2 is HeapData<T>.T) ? 1 : 0); if (num == num2) { if (this is HeapData<T>.T) { HeapData<T>.T t = (HeapData<T>.T)this; HeapData<T>.T t2 = (HeapData<T>.T)heapData; T item = t.item1; T item2 = t2.item1; if (HashCompare.GenericEqualityWithComparerIntrinsic<T>(comp, item, item2)) { FSharpList<HeapData<T>> item3 = t.item2; FSharpList<HeapData<T>> item4 = t2.item2; return ((FSharpList<HeapData<HeapData<T>>>)(object)item3).Equals((object)item4, comp); } return false; } return true; } return false; } return false; } return obj == null; } [CompilerGenerated] public virtual sealed bool Equals(HeapData<T> obj) { if (this != null) { if (obj != null) { int num = ((this is HeapData<T>.T) ? 1 : 0); int num2 = ((obj is HeapData<T>.T) ? 1 : 0); if (num == num2) { if (this is HeapData<T>.T) { HeapData<T>.T t = (HeapData<T>.T)this; HeapData<T>.T t2 = (HeapData<T>.T)obj; T item = t.item1; T item2 = t2.item1; if (HashCompare.GenericEqualityERIntrinsic<T>(item, item2)) { return HashCompare.GenericEqualityERIntrinsic<FSharpList<HeapData<T>>>(t.item2, t2.item2); } return false; } return true; } return false; } return false; } return obj == null; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is HeapData<T> obj2) { return Equals(obj2); } return false; } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public sealed class NonEmptyList<T> : IEquatable<NonEmptyList<T>>, IStructuralEquatable, IComparable<NonEmptyList<T>>, IComparable, IStructuralComparable, IReadOnlyCollection<T>, IEnumerable, IEnumerable<T> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal FSharpList<T> List@; [CompilationMapping(/*Could not decode attribute arguments.*/)] internal FSharpList<T> List => List@; public T Head => List@.Head; public FSharpList<T> Tail => List@.Tail; public int Length => List@.Length; internal NonEmptyList(FSharpList<T> list) { List@ = list; } [CompilerGenerated] public override string ToString() { return ((FSharpFunc<NonEmptyList<NonEmptyList<T>>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<NonEmptyList<T>, string>>((PrintfFormat<FSharpFunc<NonEmptyList<T>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<NonEmptyList<FSharpFunc<NonEmptyList<T>, string>>, string>, Unit, string, string, NonEmptyList<FSharpFunc<NonEmptyList<T>, string>>>("%+A"))).Invoke((NonEmptyList<NonEmptyList<T>>)(object)this); } [CompilerGenerated] public sealed int CompareTo(NonEmptyList<T> obj) { if (this != null) { if (obj != null) { IComparer genericComparer = LanguagePrimitives.GenericComparer; FSharpList<T> list@ = List@; FSharpList<T> list@2 = obj.List@; return list@.CompareTo((object)list@2, genericComparer); } return 1; } if (obj != null) { return -1; } return 0; } [CompilerGenerated] public sealed int CompareTo(object obj) { return CompareTo((NonEmptyList<T>)obj); } [CompilerGenerated] public sealed int CompareTo(object obj, IComparer comp) { NonEmptyList<T> nonEmptyList = (NonEmptyList<T>)obj; if (this != null) { if ((NonEmptyList<T>)obj != null) { FSharpList<T> list@ = List@; FSharpList<T> list@2 = nonEmptyList.List@; return list@.CompareTo((object)list@2, comp); } return 1; } if ((NonEmptyList<T>)obj != null) { return -1; } return 0; } [CompilerGenerated] public sealed int GetHashCode(IEqualityComparer comp) { if (this != null) { int num = 0; return -1640531527 + (List@.GetHashCode(comp) + ((num << 6) + (num >> 2))); } return 0; } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public sealed bool Equals(object obj, IEqualityComparer comp) { if (this != null) { if (obj is NonEmptyList<T> nonEmptyList) { FSharpList<T> list@ = List@; FSharpList<T> list@2 = nonEmptyList.List@; return list@.Equals((object)list@2, comp); } return false; } return obj == null; } virtual IEnumerator<T> IEnumerable<T>.GetEnumerator() { return ((IEnumerable<T>)List@).GetEnumerator(); } virtual IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable<T>)List@).GetEnumerator(); } [SpecialName] virtual int IReadOnlyCollection<T>.get_Count() { return List@.Length; } [CompilerGenerated] public sealed bool Equals(NonEmptyList<T> obj) { if (this != null) { if (obj != null) { return HashCompare.GenericEqualityERIntrinsic<FSharpList<T>>(List@, obj.List@); } return false; } return obj == null; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is NonEmptyList<T> obj2) { return Equals(obj2); } return false; } } [Serializable] [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal class NodeR { internal object[] array; internal FSharpOption<int> threadId@37; internal object[] Array => array; internal FSharpOption<int> ThreadId => threadId@37; public NodeR(FSharpOption<int> threadId, object[] array) { this.array = array; threadId@37 = threadId; } public NodeR() : this(null, ArrayModule.Create<object>(32, (object)null)) { } internal static NodeR InCurrentThread() { return new NodeR(FSharpOption<int>.Some(Thread.CurrentThread.ManagedThreadId), ArrayModule.Create<object>(32, (object)null)); } internal void SetThread(FSharpOption<int> t) { threadId@37 = t; } } [Serializable] [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal class TransientVect<T> { internal int count@51; internal NodeR root@52; internal object[] tail@53; internal int shift@54; public TransientVect(int count, int shift, NodeR root, object[] tail) { count@51 = count; root@52 = root; tail@53 = tail; shift@54 = shift; } public TransientVect() : this(0, 5, new NodeR(FSharpOption<int>.Some(Thread.CurrentThread.ManagedThreadId), ArrayModule.Create<object>(32, (object)null)), ArrayModule.Create<object>(32, (object)null)) { } internal NodeR EnsureEditable(NodeR node) { if (HashCompare.GenericEqualityIntrinsic<FSharpOption<int>>(node.threadId@37, root@52.threadId@37)) { return node; } return new NodeR(root@52.threadId@37, ArrayModule.Copy<object>(node.array)); } internal NodeR NewPath(int level, NodeR node) { if (level == 0) { return node; } object[] array = ArrayModule.Create<object>(32, (object)null); array[0] = NewPath(level - 5, node); return new NodeR(node.threadId@37, array); } internal NodeR PushTail(int level, NodeR parent, NodeR tailnode) { NodeR nodeR = EnsureEditable(parent); int num = (count@51 - 1 >> level) & 0x1F; object obj; if (level == 5) { obj = tailnode; } else { object obj2 = nodeR.array[num]; obj = (HashCompare.GenericEqualityIntrinsic<object>(obj2, (object)null) ? NewPath(level - 5, tailnode) : PushTail(level - 5, IntrinsicFunctions.UnboxGeneric<NodeR>(obj2), tailnode)); } NodeR nodeR2 = (NodeR)obj; nodeR.array[num] = nodeR2; return nodeR; } internal object[] ArrayFor(int i) { if (i >= 0 && i < count@51) { if (i >= TailOff()) { return tail@53; } NodeR nodeR = root@52; for (int num = shift@54; num > 0; num -= 5) { int num2 = num; int num3 = (i >> num2) & 0x1F; nodeR = IntrinsicFunctions.UnboxGeneric<NodeR>(nodeR.array[num3]); } return nodeR.array; } throw new IndexOutOfRangeException(); } internal TransientVect<T> conj<T>(T x) { EnsureEditable(); if (count@51 - TailOff() < 32) { tail@53[count@51 & 0x1F] = x; } else { NodeR nodeR = new NodeR(root@52.threadId@37, tail@53); int num = shift@54; object[] array = ArrayModule.Create<object>(32, (object)null); array[0] = x; int num2 = count@51 >> 5; int num3 = shift@54; NodeR nodeR3; if (num2 > 1 << num3) { NodeR nodeR2 = new NodeR(root@52.threadId@37, ArrayModule.Create<object>(32, (object)null)); nodeR2.array[0] = root@52; nodeR2.array[1] = NewPath(shift@54, nodeR); shift@54 += 5; nodeR3 = nodeR2; } else { nodeR3 = PushTail(shift@54, root@52, nodeR); } NodeR nodeR4 = nodeR3; tail@53 = array; root@52 = nodeR4; } count@51++; return this; } internal RandomAccessList<T> persistent() { EnsureEditable(); root@52.threadId@37 = null; int num = count@51 - TailOff(); object[] args; if (num < 0) { args = new object[3] { ErrorStrings.InputMustBeNonNegativeString, "count", num }; string message = string.Format("{0}\n{1} = {2}", args); throw new ArgumentException(message, "count"); } args = new object[num]; for (int i = 0; i < args.Length; i++) { args[i] = tail@53[i]; } object[] tail = args; return new RandomAccessList<T>(count@51, shift@54, root@52, tail); } internal void EnsureEditable() { FSharpOption<int> threadId@ = root@52.threadId@37; int managedThreadId = Thread.CurrentThread.ManagedThreadId; if (HashCompare.GenericEqualityIntrinsic<FSharpOption<int>>(threadId@, FSharpOption<int>.Some(managedThreadId))) { return; } threadId@ = root@52.threadId@37; FSharpOption<int> val = null; if (!HashCompare.GenericEqualityIntrinsic<FSharpOption<int>>(threadId@, val)) { throw new Exception("Transient used by non-owner thread"); } throw new Exception("Transient used after persistent! call"); } internal int TailOff() { if (count@51 < 32) { return 0; } return count@51 - 1 >> 5 << 5; } } [Serializable] [Class] [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class RandomAccessList<T> : IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable, IEnumerable<T>, IEquatable<RandomAccessList<T>> { internal object[] tail; internal int shift; internal NodeR root; internal int count; internal FSharpOption<int> hashCode; internal int tailOff; public bool IsEmpty => count == 0; public T this[int i] { get { int num = count - 1 - i; object[] array = ArrayFor(num); return IntrinsicFunctions.UnboxGeneric<T>(array[num & 0x1F]); } } public T Head { get { if (count > 0) { return this[0]; } throw new Exception("Can't peek empty randomAccessList"); } } public FSharpOption<T> TryHead { get { if (count > 0) { return FSharpOption<T>.Some(this[0]); } return null; } } public int Length => count; public RandomAccessList<T> Tail { get { if (count == 0) { throw new Exception("Can't tail empty randomAccessList"); } if (count == 1) { return new RandomAccessList<T>(0, 5, new NodeR(), System.Array.Empty<object>()); } object[] array; NodeR nodeR; int num3; if (count - tailOff > 1) { nodeR = new NodeR(FSharpOption<int>.Some(Thread.CurrentThread.ManagedThreadId), (object[])root.array.Clone()); int num = count - 1; int num2 = shift; NodeR nodeR2 = nodeR; array = tail; num3 = tail.Length - 1; int num4 = array.Length; int num5 = num3 - 0 + 1; int num6 = ((num5 >= 0) ? num5 : 0); object[] array2 = new object[num6]; NodeR nodeR3 = nodeR2; int num7 = num2; int num8 = num; int num9 = 0; int num10 = num6 - 1; if (num10 >= num9) { do { array2[num9] = array[0 + num9]; num9++; } while (num9 != num10 + 1); } return new TransientVect<T>(num8, num7, nodeR3, array2).persistent(); } array = ArrayFor(count - 2); nodeR = PopTail(shift, root); num3 = shift; if (HashCompare.GenericEqualityIntrinsic<NodeR>(nodeR, (NodeR)null)) { nodeR = new NodeR(); } if (shift > 5 && HashCompare.GenericEqualityIntrinsic<object>(nodeR.array[1], (object)null)) { nodeR = IntrinsicFunctions.UnboxGeneric<NodeR>(nodeR.array[0]); num3 -= 5; } return new RandomAccessList<T>(count - 1, num3, nodeR, array); } } public FSharpOption<RandomAccessList<T>> TryTail { get { if (count == 0) { return null; } return FSharpOption<RandomAccessList<RandomAccessList<T>>>.Some((RandomAccessList<RandomAccessList<T>>)(object)Tail); } } public Tuple<T, RandomAccessList<T>> Uncons { get { if (count > 0) { return new Tuple<T, RandomAccessList<T>>(this[0], Tail); } throw new Exception("Can't peek empty randomAccessList"); } } public FSharpOption<Tuple<T, RandomAccessList<T>>> TryUncons { get { if (count > 0) { return FSharpOption<Tuple<Tuple<T, RandomAccessList<T>>, RandomAccessList<Tuple<T, RandomAccessList<T>>>>>.Some((Tuple<Tuple<T, RandomAccessList<T>>, RandomAccessList<Tuple<T, RandomAccessList<T>>>>)(object)new Tuple<T, RandomAccessList<T>>(this[0], Tail)); } return null; } } internal RandomAccessList(int count, int shift, NodeR root, object[] tail) { this.count = count; this.shift = shift; this.root = root; this.tail = tail; hashCode = null; tailOff = ((this.count >= 32) ? (this.count - 1 >> 5 << 5) : 0); } internal static RandomAccessList<T> Empty() { return new RandomAccessList<T>(0, 5, new NodeR(), System.Array.Empty<object>()); } internal static RandomAccessList<T> ofSeq(IEnumerable<T> items) { TransientVect<T> transientVect = new TransientVect<T>(); IEnumerable<T> enumerable = (IEnumerable<T>)ListModule.Reverse<T>(SeqModule.ToList<T>(items)); foreach (T item in enumerable) { transientVect = transientVect.conj<object>(item); } return transientVect.persistent(); } public override int GetHashCode() { FSharpOption<int> val = hashCode; if (val == null) { int num = 1; IEnumerable<T> enumerable = rangedIterator<object>(0, count); foreach (T item in enumerable) { num = 31 * num + HashCompare.GenericHashIntrinsic<T>(item); } hashCode = FSharpOption<int>.Some(num); return num; } return val.Value; } public override bool Equals(object other) { if (other is RandomAccessList<T> randomAccessList) { RandomAccessList<T> other2 = randomAccessList; return ((IEquatable<RandomAccessList<T>>)this).Equals(other2); } return false; } internal RandomAccessList<T> SetHash(FSharpOption<int> hash) { hashCode = hash; return this; } internal NodeR NewPath(int level, NodeR node) { if (level == 0) { return node; } NodeR nodeR = new NodeR(root.threadId@37, ArrayModule.Create<object>(32, (object)null)); nodeR.array[0] = NewPath(level - 5, node); return nodeR; } internal NodeR PushTail(int level, NodeR parent, NodeR tailnode) { int num = (count - 1 >> level) & 0x1F; NodeR nodeR = new NodeR(parent.threadId@37, ArrayModule.Copy<object>(parent.array)); object obj; if (level == 5) { obj = tailnode; } else { object obj2 = parent.array[num]; obj = (HashCompare.GenericEqualityIntrinsic<object>(obj2, (object)null) ? NewPath(level - 5, tailnode) : PushTail(level - 5, IntrinsicFunctions.UnboxGeneric<NodeR>(obj2), tailnode)); } NodeR nodeR2 = (NodeR)obj; nodeR.array[num] = nodeR2; return nodeR; } internal object[] ArrayFor(int i) { if (i >= 0 && i < count) { if (i >= tailOff) { return tail; } NodeR nodeR = root; for (int num = shift; num > 0; num -= 5) { int num2 = num; int num3 = (i >> num2) & 0x1F; nodeR = IntrinsicFunctions.UnboxGeneric<NodeR>(nodeR.array[num3]); } return nodeR.array; } throw new IndexOutOfRangeException(); } internal NodeR doAssoc<a>(int level, NodeR node, int i, a x) { NodeR nodeR = new NodeR(root.threadId@37, ArrayModule.Copy<object>(node.array)); if (level == 0) { nodeR.array[i & 0x1F] = x; } else { int num = (i >> level) & 0x1F; nodeR.array[num] = doAssoc(level - 5, IntrinsicFunctions.UnboxGeneric<NodeR>(node.array[num]), i, x); } return nodeR; } internal NodeR PopTail(int level, NodeR node) { int num = (count - 2 >> level) & 0x1F; NodeR nodeR; if (level > 5) { nodeR = PopTail(level - 5, IntrinsicFunctions.UnboxGeneric<NodeR>(node.array[num])); if (HashCompare.GenericEqualityIntrinsic<NodeR>(nodeR, (NodeR)null) && num == 0) { return null; } NodeR nodeR2 = new NodeR(root.threadId@37, ArrayModule.Copy<object>(node.array)); nodeR2.array[num] = nodeR; return nodeR2; } if (num == 0) { return null; } nodeR = new NodeR(root.threadId@37, ArrayModule.Copy<object>(node.array)); nodeR.array[num] = null; return nodeR; } internal IEnumerable<T> rangedIterator<T>(int startIndex, int endIndex) { if (count == 0) { return SeqModule.Empty<T>(); } FSharpRef<int> val = new FSharpRef<int>(endIndex - 1); FSharpRef<object[]> array = new FSharpRef<object[]>((endIndex - 1 >= count) ? null : ArrayFor(val.contents)); return (IEnumerable<T>)(object)new $RandomAccessList.rangedIterator@298<T>(this, startIndex, val, array, 0, default(T)); } public RandomAccessList<T> Cons(T x) { if (count - tailOff < 32) { object[] array = ArrayModule.Append<object>(tail, new object[1] { x }); return new RandomAccessList<T>(count + 1, shift, root, array); } NodeR nodeR = new NodeR(root.threadId@37, tail); int num = count >> 5; int num2 = shift; NodeR nodeR2; if (num > 1 << num2) { nodeR2 = new NodeR(); nodeR2.array[0] = root; nodeR2.array[1] = NewPath(shift, nodeR); return new RandomAccessList<T>(count + 1, shift + 5, nodeR2, new object[1] { x }); } nodeR2 = PushTail(shift, root, nodeR); return new RandomAccessList<T>(count + 1, shift, nodeR2, new object[1] { x }); } public RandomAccessList<T> Rev() { if (count == 0) { return new RandomAccessList<T>(0, 5, new NodeR(), System.Array.Empty<object>()); } TransientVect<T> transientVect = new TransientVect<T>(); IEnumerable<T> enumerable = rangedIterator<object>(0, count); foreach (T item in enumerable) { transientVect = transientVect.conj<object>(item); } return transientVect.persistent(); } public RandomAccessList<T> Update(int i, T x) { int num = count - 1 - i; if (num >= 0 && num < count) { if (num >= tailOff) { object[] array = ArrayModule.Copy<object>(tail); array[num & 0x1F] = x; return new RandomAccessList<T>(count, shift, root, array); } return new RandomAccessList<T>(count, shift, doAssoc(shift, root, num, x), tail); } if (num == count) { return Cons(x); } throw new IndexOutOfRangeException(); } public FSharpOption<RandomAccessList<T>> TryUpdate(int i, T x) { if (i >= 0 && i < count) { return FSharpOption<RandomAccessList<RandomAccessList<T>>>.Some((RandomAccessList<RandomAccessList<T>>)(object)Update(i, x)); } return null; } virtual bool IEquatable<RandomAccessList<T>>.Equals(RandomAccessList<T> y) { if (count != y.count) { return false; } if (GetHashCode() != y.GetHashCode()) { return false; } return SeqModule.ForAll2<T, T>((FSharpFunc<T, FSharpFunc<T, bool>>)(object)$RandomAccessList.System-IEquatable<FSharpx-Collections-RandomAccessList<'T>>-Equals@421<T>.@_instance, (IEnumerable<T>)this, (IEnumerable<T>)y); } virtual IEnumerator<T> IEnumerable<T>.GetEnumerator() { return rangedIterator<object>(0, count).GetEnumerator(); } virtual IEnumerator IEnumerable.GetEnumerator() { return rangedIterator<object>(0, count).GetEnumerator(); } [SpecialName] virtual int IReadOnlyCollection<T>.get_Count() { return count; } [SpecialName] virtual T IReadOnlyList<T>.get_Item(int i) { return this[i]; } } [Serializable] [Class] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class Queue<T> : IReadOnlyCollection<T>, IEnumerable, IEnumerable<T>, IEquatable<Queue<T>> { internal FSharpList<T> rBack@5; internal FSharpList<T> front@5; internal FSharpOption<int> hashCode; internal FSharpList<T> front => front@5; internal FSharpList<T> rBack => rBack@5; public T Head { get { FSharpList<T> val = front@5; if (val.TailOrNull != null) { return val.HeadOrDefault; } throw new Exception("Queue is empty"); } } public FSharpOption<T> TryHead { get { FSharpList<T> val = front@5; if (val.TailOrNull != null) { FSharpList<T> val2 = val; return FSharpOption<T>.Some(val2.HeadOrDefault); } return null; } } public bool IsEmpty => front@5.TailOrNull == null; public int Length => front@5.Length + rBack@5.Length; public Queue<T> Tail { get { FSharpList<T> val = front@5; if (val.TailOrNull != null) { FSharpList<T> val2 = val; FSharpList<T> tailOrNull = val2.TailOrNull; FSharpList<T> val3 = rBack@5; if (tailOrNull.TailOrNull == null) { return new Queue<T>(ListModule.Reverse<T>(val3), FSharpList<T>.Empty); } return new Queue<T>(tailOrNull, val3); } throw new Exception("Queue is empty"); } } public FSharpOption<Queue<T>> TryTail { get { FSharpList<T> val = front@5; if (val.TailOrNull != null) { FSharpList<T> val2 = val; FSharpList<T> tailOrNull = val2.TailOrNull; FSharpList<T> val3 = rBack@5; if (tailOrNull.TailOrNull == null) { return FSharpOption<Queue<Queue<T>>>.Some((Queue<Queue<T>>)(object)new Queue<T>(ListModule.Reverse<T>(val3), FSharpList<T>.Empty)); } return FSharpOption<Queue<Queue<T>>>.Some((Queue<Queue<T>>)(object)new Queue<T>(tailOrNull, val3)); } return null; } } public Tuple<T, Queue<T>> Uncons { get { FSharpList<T> val = front@5; if (val.TailOrNull != null) { FSharpList<T> val2 = val; FSharpList<T> tailOrNull = val2.TailOrNull; T headOrDefault = val2.HeadOrDefault; FSharpList<T> val3 = rBack@5; return new Tuple<T, Queue<T>>(headOrDefault, (tailOrNull.TailOrNull != null) ? new Queue<T>(tailOrNull, val3) : new Queue<T>(ListModule.Reverse<T>(val3), FSharpList<T>.Empty)); } throw new Exception("Queue is empty"); } } public FSharpOption<Tuple<T, Queue<T>>> TryUncons { get { FSharpList<T> val = front@5; if (val.TailOrNull != null) { FSharpList<T> val2 = val; FSharpList<T> tailOrNull = val2.TailOrNull; T headOrDefault = val2.HeadOrDefault; FSharpList<T> val3 = rBack@5; if (tailOrNull.TailOrNull == null) { return FSharpOption<Tuple<Tuple<T, Queue<T>>, Queue<Tuple<T, Queue<T>>>>>.Some((Tuple<Tuple<T, Queue<T>>, Queue<Tuple<T, Queue<T>>>>)(object)new Tuple<T, Queue<T>>(headOrDefault, new Queue<T>(ListModule.Reverse<T>(val3), FSharpList<T>.Empty))); } return FSharpOption<Tuple<Tuple<T, Queue<T>>, Queue<Tuple<T, Queue<T>>>>>.Some((Tuple<Tuple<T, Queue<T>>, Queue<Tuple<T, Queue<T>>>>)(object)new Tuple<T, Queue<T>>(headOrDefault, new Queue<T>(tailOrNull, val3))); } return null; } } internal Queue(FSharpList<T> front, FSharpList<T> rBack) { front@5 = front; rBack@5 = rBack; hashCode = null; } public override int GetHashCode() { FSharpOption<int> val = hashCode; if (val == null) { int num = 1; foreach (T item in (IEnumerable<T>)this) { num = 31 * num + HashCompare.GenericHashIntrinsic<T>(item); } hashCode = FSharpOption<int>.Some(num); return num; } return val.Value; } public override bool Equals(object other) { if (other is Queue<T> queue) { Queue<T> other2 = queue; return ((IEquatable<Queue<T>>)this).Equals(other2); } return false; } public Queue<T> Conj(T x) { FSharpList<T> val = front@5; FSharpList<T> val2 = FSharpList<T>.Cons(x, rBack@5); if (val.TailOrNull == null) { return new Queue<T>(ListModule.Reverse<T>(val2), FSharpList<T>.Empty); } return new Queue<T>(val, val2); } public Queue<T> Rev() { FSharpList<T> val = rBack@5; FSharpList<T> val2 = front@5; if (val.TailOrNull == null) { return new Queue<T>(ListModule.Reverse<T>(val2), FSharpList<T>.Empty); } return new Queue<T>(val, val2); } virtual bool IEquatable<Queue<T>>.Equals(Queue<T> y) { if (front@5.Length + rBack@5.Length != y.front@5.Length + y.rBack@5.Length) { return false; } if (GetHashCode() != y.GetHashCode()) { return false; } return SeqModule.ForAll2<T, T>((FSharpFunc<T, FSharpFunc<T, bool>>)(object)$Queue.System-IEquatable<FSharpx-Collections-Queue<'T>>-Equals@88<T>.@_instance, (IEnumerable<T>)this, (IEnumerable<T>)y); } virtual IEnumerator<T> IEnumerable<T>.GetEnumerator() { return ((IEnumerable<T>)(object)new $Queue.System-Collections-Generic-IEnumerable<'T>-GetEnumerator@93-1<T>(this, null, 0, default(T))).GetEnumerator(); } virtual IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable<T>)this).GetEnumerator(); } [SpecialName] virtual int IReadOnlyCollection<T>.get_Count() { return front@5.Length + rBack@5.Length; } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal class Node { internal object[] array; internal FSharpRef<Thread> thread@10; internal object[] Array => array; internal FSharpRef<Thread> Thread => thread@10; public Node(FSharpRef<Thread> thread, object[] array) { this.array = array; thread@10 = thread; } public Node() : this(new FSharpRef<Thread>((Thread)null), ArrayModule.Create<object>(32, (object)null)) { } internal static Node InCurrentThread() { return new Node(new FSharpRef<Thread>(System.Threading.Thread.CurrentThread), ArrayModule.Create<object>(32, (object)null)); } internal void SetThread(Thread t) { thread@10.contents = t; } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal class TransientVector<T> : IEnumerable, IEnumerable<T> { internal int count@32; internal Node root@33; internal object[] tail@34; internal int shift@35; public TransientVector(int count, int shift, Node root, object[] tail) { count@32 = count; root@33 = root; tail@34 = tail; shift@35 = shift; } public TransientVector() : this(0, 5, new Node(new FSharpRef<Thread>(Thread.CurrentThread), ArrayModule.Create<object>(32, (object)null)), ArrayModule.Create<object>(32, (object)null)) { } internal Node EnsureEditable(Node node) { FSharpRef<Thread> thread@ = node.thread@10; FSharpRef<Thread> thread@2 = root@33.thread@10; if (thread@.Equals((object)thread@2, LanguagePrimitives.GenericEqualityComparer)) { return node; } return new Node(root@33.thread@10, ArrayModule.Copy<object>(node.array)); } internal Node NewPath(int level, Node node) { if (level == 0) { return node; } object[] array = ArrayModule.Create<object>(32, (object)null); array[0] = NewPath(level - 5, node); return new Node(node.thread@10, array); } internal Node PushTail(int level, Node parent, Node tailnode) { Node node = EnsureEditable(parent); int num = (count@32 - 1 >> level) & 0x1F; object obj; if (level == 5) { obj = tailnode; } else { object obj2 = node.array[num]; obj = (HashCompare.GenericEqualityIntrinsic<object>(obj2, (object)null) ? NewPath(level - 5, tailnode) : PushTail(level - 5, IntrinsicFunctions.UnboxGeneric<Node>(obj2), tailnode)); } Node node2 = (Node)obj; node.array[num] = node2; return node; } internal object[] ArrayFor(int i) { if (i >= 0 && i < count@32) { if (i >= TailOff()) { return tail@34; } Node node = root@33; for (int num = shift@35; num > 0; num -= 5) { int num2 = num; int num3 = (i >> num2) & 0x1F; node = IntrinsicFunctions.UnboxGeneric<Node>(node.array[num3]); } return node.array; } throw new IndexOutOfRangeException(); } internal TransientVector<T> conj<T>(T x) { EnsureEditable(); if (count@32 - TailOff() < 32) { tail@34[count@32 & 0x1F] = x; } else { Node node = new Node(root@33.thread@10, tail@34); int num = shift@35; object[] array = ArrayModule.Create<object>(32, (object)null); array[0] = x; int num2 = count@32 >> 5; int num3 = shift@35; Node node3; if (num2 > 1 << num3) { Node node2 = new Node(root@33.thread@10, ArrayModule.Create<object>(32, (object)null)); node2.array[0] = root@33; node2.array[1] = NewPath(shift@35, node); shift@35 += 5; node3 = node2; } else { node3 = PushTail(shift@35, root@33, node); } Node node4 = node3; tail@34 = array; root@33 = node4; } count@32++; return this; } internal IEnumerable<T> rangedIterator<T>(int startIndex, int endIndex) { FSharpRef<int> val = new FSharpRef<int>(startIndex); FSharpRef<int> b = new FSharpRef<int>(val.contents - val.contents % 32); FSharpRef<object[]> array = new FSharpRef<object[]>((startIndex >= count@32) ? null : ArrayFor(val.contents)); return (IEnumerable<T>)(object)new $PersistentVector.rangedIterator@147-1<T>(this, endIndex, val, b, array, 0, default(T)); } internal PersistentVector<T> persistent() { EnsureEditable(); Node node = root@33; node.thread@10.contents = null; int num = count@32 - TailOff(); object[] args; if (num < 0) { args = new object[3] { ErrorStrings.InputMustBeNonNegativeString, "count", num }; string message = string.Format("{0}\n{1} = {2}", args); throw new ArgumentException(message, "count"); } args = new object[num]; for (int i = 0; i < args.Length; i++) { args[i] = tail@34[i]; } object[] tail = args; return new PersistentVector<T>(count@32, shift@35, root@33, tail); } internal void EnsureEditable() { if (HashCompare.GenericEqualityIntrinsic<Thread>(root@33.thread@10.contents, Thread.CurrentThread)) { return; } Thread contents = root@33.thread@10.contents; if (!HashCompare.GenericEqualityIntrinsic<Thread>(contents, (Thread)null)) { throw new Exception("Transient used by non-owner thread"); } throw new Exception("Transient used after persistent! call"); } internal int TailOff() { if (count@32 < 32) { return 0; } return count@32 - 1 >> 5 << 5; } virtual IEnumerator<T> IEnumerable<T>.GetEnumerator() { return rangedIterator<object>(0, count@32).GetEnumerator(); } virtual IEnumerator IEnumerable.GetEnumerator() { return rangedIterator<object>(0, count@32).GetEnumerator(); } } [Serializable] [Class] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class PersistentVector<T> : IReadOnlyCollection<T> { internal object[] tail; internal int shift; internal Node root; internal int count; internal FSharpOption<int> hashCode; internal int tailOff; public PersistentVector<T> Initial { get { if (count == 0) { throw new Exception("Can't initial empty vector"); } if (count == 1) { return new PersistentVector<T>(0, 5, new Node(), System.Array.Empty<object>()); } object[] array; Node node; int num3; if (count - tailOff > 1) { node = new Node(new FSharpRef<Thread>(Thread.CurrentThread), ArrayModule.Copy<object>(root.array)); int num = count - 1; int num2 = shift; Node node2 = node; array = tail; num3 = tail.Length - 1; int num4 = array.Length; int num5 = num3 - 0 + 1; int num6 = ((num5 >= 0) ? num5 : 0); object[] array2 = new object[num6]; Node node3 = node2; int num7 = num2; int num8 = num; int num9 = 0; int num10 = num6 - 1; if (num10 >= num9) { do { array2[num9] = array[0 + num9]; num9++; } while (num9 != num10 + 1); } return new TransientVector<T>(num8, num7, node3, array2).persistent(); } array = ArrayFor(count - 2); node = PopTail(shift, root); num3 = shift; if (HashCompare.GenericEqualityIntrinsic<Node>(node, (Node)null)) { node = new Node(); } if (shift > 5 && HashCompare.GenericEqualityIntrinsic<object>(node.array[1], (object)null)) { node = IntrinsicFunctions.UnboxGeneric<Node>(node.array[0]); num3 -= 5; } return new PersistentVector<T>(count - 1, num3, node, array); } } public FSharpOption<PersistentVector<T>> TryInitial { get { if (count == 0) { return null; } return FSharpOption<PersistentVector<PersistentVector<T>>>.Some((PersistentVector<PersistentVector<T>>)(object)Initial); } } public bool IsEmpty => count == 0; public T this[int i] { get { object[] array = ArrayFor(i); return IntrinsicFunctions.UnboxGeneric<T>(array[i & 0x1F]); } } public T Last { get { if (count > 0) { return this[count - 1]; } throw new Exception("Can't peek empty vector"); } } public FSharpOption<T> TryLast { get { if (count > 0) { return FSharpOption<T>.Some(this[count - 1]); } return null; } } public int Length => count; public Tuple<PersistentVector<T>, T> Unconj { get { if (count > 0) { return new Tuple<PersistentVector<T>, T>(Initial, this[count - 1]); } throw new Exception("Can't peek empty vector"); } } public FSharpOption<Tuple<PersistentVector<T>, T>> TryUnconj { get { if (count > 0) { return FSharpOption<Tuple<PersistentVector<Tuple<PersistentVector<T>, T>>, Tuple<PersistentVector<T>, T>>>.Some((Tuple<PersistentVector<Tuple<PersistentVector<T>, T>>, Tuple<PersistentVector<T>, T>>)(object)new Tuple<PersistentVector<T>, T>(Initial, this[count - 1])); } return null; } } internal PersistentVector(int count, int shift, Node root, object[] tail) { this.count = count; this.shift = shift;
BepInEx/core/Mirage.Core/MathNet.Numerics.dll
Decompiled a month ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.Linq; using System.Numerics; using System.Reflection; using System.Resources; using System.Runtime; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Runtime.Versioning; using System.Security.Cryptography; using System.Text; using System.Threading; using System.Threading.Tasks; using MathNet.Numerics.Differentiation; using MathNet.Numerics.Distributions; using MathNet.Numerics.IntegralTransforms; using MathNet.Numerics.Integration; using MathNet.Numerics.Integration.GaussRule; using MathNet.Numerics.Interpolation; using MathNet.Numerics.LinearAlgebra; using MathNet.Numerics.LinearAlgebra.Complex; using MathNet.Numerics.LinearAlgebra.Complex.Factorization; using MathNet.Numerics.LinearAlgebra.Complex32; using MathNet.Numerics.LinearAlgebra.Complex32.Factorization; using MathNet.Numerics.LinearAlgebra.Double; using MathNet.Numerics.LinearAlgebra.Double.Factorization; using MathNet.Numerics.LinearAlgebra.Factorization; using MathNet.Numerics.LinearAlgebra.Single; using MathNet.Numerics.LinearAlgebra.Single.Factorization; using MathNet.Numerics.LinearAlgebra.Solvers; using MathNet.Numerics.LinearAlgebra.Storage; using MathNet.Numerics.LinearRegression; using MathNet.Numerics.Optimization; using MathNet.Numerics.Optimization.LineSearch; using MathNet.Numerics.Optimization.ObjectiveFunctions; using MathNet.Numerics.Optimization.TrustRegion.Subproblems; using MathNet.Numerics.Providers.FourierTransform; using MathNet.Numerics.Providers.LinearAlgebra; using MathNet.Numerics.Providers.SparseSolver; using MathNet.Numerics.Random; using MathNet.Numerics.RootFinding; using MathNet.Numerics.Statistics; using MathNet.Numerics.Threading; using Microsoft.CodeAnalysis; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: CLSCompliant(true)] [assembly: ComVisible(false)] [assembly: Guid("7b66646f-f0ee-425d-9065-910d1937a2df")] [assembly: InternalsVisibleTo("MathNet.Numerics.Tests")] [assembly: InternalsVisibleTo("MathNet.Numerics.Tests.MKL")] [assembly: InternalsVisibleTo("MathNet.Numerics.Tests.CUDA")] [assembly: InternalsVisibleTo("MathNet.Numerics.Tests.OpenBLAS")] [assembly: InternalsVisibleTo("Benchmark")] [assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = "")] [assembly: AssemblyCompany("Math.NET Project")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCopyright("Copyright Math.NET Project")] [assembly: AssemblyDescription("Math.NET Numerics is the numerical foundation of the Math.NET project, aiming to provide methods and algorithms for numerical computations in science, engineering and every day use. Supports .NET 5.0 or higher, .NET Standard 2.0 and .NET Framework 4.6.1 or higher, on Windows, Linux and Mac.")] [assembly: AssemblyFileVersion("5.0.0.0")] [assembly: AssemblyInformationalVersion("5.0.0")] [assembly: AssemblyProduct("Math.NET Numerics")] [assembly: AssemblyTitle("MathNet.Numerics")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/mathnet/mathnet-numerics")] [assembly: NeutralResourcesLanguage("en")] [assembly: AssemblyVersion("5.0.0.0")] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class IsReadOnlyAttribute : Attribute { } } namespace MathNet.Numerics { public static class AppSwitches { private const string AppSwitchDisableNativeProviderProbing = "Switch.MathNet.Numerics.Providers.DisableNativeProviderProbing"; private const string AppSwitchDisableNativeProviders = "Switch.MathNet.Numerics.Providers.DisableNativeProviders"; private const string AppSwitchDisableMklNativeProvider = "Switch.MathNet.Numerics.Providers.DisableMklNativeProvider"; private const string AppSwitchDisableCudaNativeProvider = "Switch.MathNet.Numerics.Providers.DisableCudaNativeProvider"; private const string AppSwitchDisableOpenBlasNativeProvider = "Switch.MathNet.Numerics.Providers.DisableOpenBlasNativeProvider"; public static bool DisableNativeProviderProbing { get { return IsEnabled("Switch.MathNet.Numerics.Providers.DisableNativeProviderProbing"); } set { SetSwitch("Switch.MathNet.Numerics.Providers.DisableNativeProviderProbing", value); } } public static bool DisableNativeProviders { get { return IsEnabled("Switch.MathNet.Numerics.Providers.DisableNativeProviders"); } set { SetSwitch("Switch.MathNet.Numerics.Providers.DisableNativeProviders", value); } } public static bool DisableMklNativeProvider { get { return IsEnabled("Switch.MathNet.Numerics.Providers.DisableMklNativeProvider"); } set { SetSwitch("Switch.MathNet.Numerics.Providers.DisableMklNativeProvider", value); } } public static bool DisableCudaNativeProvider { get { return IsEnabled("Switch.MathNet.Numerics.Providers.DisableCudaNativeProvider"); } set { SetSwitch("Switch.MathNet.Numerics.Providers.DisableCudaNativeProvider", value); } } public static bool DisableOpenBlasNativeProvider { get { return IsEnabled("Switch.MathNet.Numerics.Providers.DisableOpenBlasNativeProvider"); } set { SetSwitch("Switch.MathNet.Numerics.Providers.DisableOpenBlasNativeProvider", value); } } private static void SetSwitch(string switchName, bool isEnabled) { AppContext.SetSwitch(switchName, isEnabled); } private static bool IsEnabled(string switchName) { bool isEnabled; return AppContext.TryGetSwitch(switchName, out isEnabled) && isEnabled; } } internal static class ArrayExtensions { public static void Copy(this double[] source, double[] dest) { Buffer.BlockCopy(source, 0, dest, 0, source.Length * 8); } public static void Copy(this float[] source, float[] dest) { Buffer.BlockCopy(source, 0, dest, 0, source.Length * 4); } public static void Copy(this Complex[] source, Complex[] dest) { Array.Copy(source, 0, dest, 0, source.Length); } public static void Copy(this Complex32[] source, Complex32[] dest) { Array.Copy(source, 0, dest, 0, source.Length); } } public static class Combinatorics { public static double Variations(int n, int k) { if (k < 0 || n < 0 || k > n) { return 0.0; } return Math.Floor(0.5 + Math.Exp(SpecialFunctions.FactorialLn(n) - SpecialFunctions.FactorialLn(n - k))); } public static double VariationsWithRepetition(int n, int k) { if (k < 0 || n < 0) { return 0.0; } return Math.Pow(n, k); } public static double Combinations(int n, int k) { return SpecialFunctions.Binomial(n, k); } public static double CombinationsWithRepetition(int n, int k) { if (k < 0 || n < 0 || (n == 0 && k > 0)) { return 0.0; } if (n == 0 && k == 0) { return 1.0; } return Math.Floor(0.5 + Math.Exp(SpecialFunctions.FactorialLn(n + k - 1) - SpecialFunctions.FactorialLn(k) - SpecialFunctions.FactorialLn(n - 1))); } public static double Permutations(int n) { return SpecialFunctions.Factorial(n); } public static int[] GeneratePermutation(int n, System.Random randomSource = null) { if (n < 0) { throw new ArgumentOutOfRangeException("n", "Value must not be negative (zero is ok)."); } int[] array = new int[n]; for (int i = 0; i < array.Length; i++) { array[i] = i; } SelectPermutationInplace(array, randomSource); return array; } public static void SelectPermutationInplace<T>(T[] data, System.Random randomSource = null) { System.Random random = randomSource ?? SystemRandomSource.Default; for (int num = data.Length - 1; num > 0; num--) { int num2 = random.Next(num + 1); int num3 = num; int num4 = num2; T val = data[num2]; T val2 = data[num]; data[num3] = val; data[num4] = val2; } } public static IEnumerable<T> SelectPermutation<T>(this IEnumerable<T> data, System.Random randomSource = null) { System.Random random = randomSource ?? SystemRandomSource.Default; T[] array = data.ToArray(); for (int i = array.Length - 1; i >= 0; i--) { int j = random.Next(i + 1); yield return array[j]; array[j] = array[i]; } } public static bool[] GenerateCombination(int n, System.Random randomSource = null) { if (n < 0) { throw new ArgumentOutOfRangeException("n", "Value must not be negative (zero is ok)."); } System.Random rnd = randomSource ?? SystemRandomSource.Default; bool[] array = new bool[n]; for (int i = 0; i < array.Length; i++) { array[i] = rnd.NextBoolean(); } return array; } public static bool[] GenerateCombination(int n, int k, System.Random randomSource = null) { if (n < 0) { throw new ArgumentOutOfRangeException("n", "Value must not be negative (zero is ok)."); } if (k < 0) { throw new ArgumentOutOfRangeException("k", "Value must not be negative (zero is ok)."); } if (k > n) { throw new ArgumentOutOfRangeException("k", "k must be smaller than or equal to n."); } System.Random random = randomSource ?? SystemRandomSource.Default; bool[] array = new bool[n]; if (k * 3 < n) { int num = 0; while (num < k) { int num2 = random.Next(n); if (!array[num2]) { array[num2] = true; num++; } } return array; } int[] array2 = GeneratePermutation(n, random); for (int i = 0; i < k; i++) { array[array2[i]] = true; } return array; } public static IEnumerable<T> SelectCombination<T>(this IEnumerable<T> data, int elementsToChoose, System.Random randomSource = null) { T[] array = (data as T[]) ?? data.ToArray(); if (elementsToChoose < 0) { throw new ArgumentOutOfRangeException("elementsToChoose", "Value must not be negative (zero is ok)."); } if (elementsToChoose > array.Length) { throw new ArgumentOutOfRangeException("elementsToChoose", "elementsToChoose must be smaller than or equal to data.Count."); } bool[] mask = GenerateCombination(array.Length, elementsToChoose, randomSource); for (int i = 0; i < mask.Length; i++) { if (mask[i]) { yield return array[i]; } } } public static int[] GenerateCombinationWithRepetition(int n, int k, System.Random randomSource = null) { if (n < 0) { throw new ArgumentOutOfRangeException("n", "Value must not be negative (zero is ok)."); } if (k < 0) { throw new ArgumentOutOfRangeException("k", "Value must not be negative (zero is ok)."); } System.Random random = randomSource ?? SystemRandomSource.Default; int[] array = new int[n]; for (int i = 0; i < k; i++) { array[random.Next(n)]++; } return array; } public static IEnumerable<T> SelectCombinationWithRepetition<T>(this IEnumerable<T> data, int elementsToChoose, System.Random randomSource = null) { if (elementsToChoose < 0) { throw new ArgumentOutOfRangeException("elementsToChoose", "Value must not be negative (zero is ok)."); } T[] array = (data as T[]) ?? data.ToArray(); int[] mask = GenerateCombinationWithRepetition(array.Length, elementsToChoose, randomSource); for (int i = 0; i < mask.Length; i++) { for (int j = 0; j < mask[i]; j++) { yield return array[i]; } } } public static int[] GenerateVariation(int n, int k, System.Random randomSource = null) { if (n < 0) { throw new ArgumentOutOfRangeException("n", "Value must not be negative (zero is ok)."); } if (k < 0) { throw new ArgumentOutOfRangeException("k", "Value must not be negative (zero is ok)."); } if (k > n) { throw new ArgumentOutOfRangeException("k", "k must be smaller than or equal to n."); } System.Random random = randomSource ?? SystemRandomSource.Default; int[] array = new int[n]; for (int i = 0; i < array.Length; i++) { array[i] = i; } int[] array2 = new int[k]; int num = 0; int num2 = array.Length - 1; while (num < array2.Length) { int num3 = random.Next(num2 + 1); array2[num] = array[num3]; array[num3] = array[num2]; num++; num2--; } return array2; } public static BigInteger[] GenerateVariation(BigInteger n, int k, System.Random randomSource = null) { if (n < 0L) { throw new ArgumentOutOfRangeException("n", "Value must not be negative (zero is ok)."); } if (k < 0) { throw new ArgumentOutOfRangeException("k", "Value must not be negative (zero is ok)."); } if (k > n) { throw new ArgumentOutOfRangeException("k", "k must be smaller than or equal to n."); } System.Random rnd = randomSource ?? SystemRandomSource.Default; BigInteger[] array = new BigInteger[k]; if (n == 0L || k == 0) { return array; } array[0] = rnd.NextBigIntegerSequence(BigInteger.Zero, n).First(); for (int i = 1; i < k; i++) { BigInteger bigInteger = rnd.NextBigIntegerSequence(BigInteger.Zero, n - i).First(); bool[] array2 = Generate.Repeat(i, value: true); bool flag; do { flag = false; for (int j = 0; j < i; j++) { if (array2[j] && bigInteger >= array[j]) { array2[j] = false; flag = true; ++bigInteger; } } } while (flag); array[i] = bigInteger; } return array; } public static IEnumerable<T> SelectVariation<T>(this IEnumerable<T> data, int elementsToChoose, System.Random randomSource = null) { System.Random random = randomSource ?? SystemRandomSource.Default; T[] array = data.ToArray(); if (elementsToChoose < 0) { throw new ArgumentOutOfRangeException("elementsToChoose", "Value must not be negative (zero is ok)."); } if (elementsToChoose > array.Length) { throw new ArgumentOutOfRangeException("elementsToChoose", "elementsToChoose must be smaller than or equal to data.Count."); } for (int i = array.Length - 1; i >= array.Length - elementsToChoose; i--) { int swapIndex = random.Next(i + 1); yield return array[swapIndex]; array[swapIndex] = array[i]; } } public static int[] GenerateVariationWithRepetition(int n, int k, System.Random randomSource = null) { if (n < 0) { throw new ArgumentOutOfRangeException("n", "Value must not be negative (zero is ok)."); } if (k < 0) { throw new ArgumentOutOfRangeException("k", "Value must not be negative (zero is ok)."); } System.Random rnd = randomSource ?? SystemRandomSource.Default; int[] array = new int[k]; rnd.NextInt32s(array, 0, n); return array; } public static IEnumerable<T> SelectVariationWithRepetition<T>(this IEnumerable<T> data, int elementsToChoose, System.Random randomSource = null) { if (elementsToChoose < 0) { throw new ArgumentOutOfRangeException("elementsToChoose", "Value must not be negative (zero is ok)."); } T[] array = (data as T[]) ?? data.ToArray(); int[] indices = GenerateVariationWithRepetition(array.Length, elementsToChoose, randomSource); for (int i = 0; i < indices.Length; i++) { yield return array[indices[i]]; } } } [Serializable] [DataContract(Namespace = "urn:MathNet/Numerics")] public readonly struct Complex32 : IFormattable, IEquatable<Complex32> { [DataMember(Order = 1)] private readonly float _real; [DataMember(Order = 2)] private readonly float _imag; public static readonly Complex32 Zero = new Complex32(0f, 0f); public static readonly Complex32 One = new Complex32(1f, 0f); public static readonly Complex32 ImaginaryOne = new Complex32(0f, 1f); public static readonly Complex32 PositiveInfinity = new Complex32(float.PositiveInfinity, float.PositiveInfinity); public static readonly Complex32 NaN = new Complex32(float.NaN, float.NaN); public float Real { [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] get { return _real; } } public float Imaginary { [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] get { return _imag; } } public float Phase { [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] get { if (_imag != 0f || !(_real < 0f)) { return (float)Math.Atan2(_imag, _real); } return MathF.PI; } } public float Magnitude { [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] get { if (float.IsNaN(_real) || float.IsNaN(_imag)) { return float.NaN; } if (float.IsInfinity(_real) || float.IsInfinity(_imag)) { return float.PositiveInfinity; } float num = Math.Abs(_real); float num2 = Math.Abs(_imag); if (num > num2) { double num3 = num2 / num; return num * (float)Math.Sqrt(1.0 + num3 * num3); } if (num == 0f) { return num2; } double num4 = num / num2; return num2 * (float)Math.Sqrt(1.0 + num4 * num4); } } public float MagnitudeSquared => _real * _real + _imag * _imag; public Complex32 Sign { get { if (float.IsPositiveInfinity(_real) && float.IsPositiveInfinity(_imag)) { return new Complex32(0.70710677f, 0.70710677f); } if (float.IsPositiveInfinity(_real) && float.IsNegativeInfinity(_imag)) { return new Complex32(0.70710677f, -0.70710677f); } if (float.IsNegativeInfinity(_real) && float.IsPositiveInfinity(_imag)) { return new Complex32(-0.70710677f, -0.70710677f); } if (float.IsNegativeInfinity(_real) && float.IsNegativeInfinity(_imag)) { return new Complex32(-0.70710677f, 0.70710677f); } float num = SpecialFunctions.Hypotenuse(_real, _imag); if (num == 0f) { return Zero; } return new Complex32(_real / num, _imag / num); } } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public Complex32(float real, float imaginary) { _real = real; _imag = imaginary; } public static Complex32 FromPolarCoordinates(float magnitude, float phase) { return new Complex32(magnitude * (float)Math.Cos(phase), magnitude * (float)Math.Sin(phase)); } public bool IsZero() { if (_real == 0f) { return _imag == 0f; } return false; } public bool IsOne() { if (_real == 1f) { return _imag == 0f; } return false; } public bool IsImaginaryOne() { if (_real == 0f) { return _imag == 1f; } return false; } public bool IsNaN() { if (!float.IsNaN(_real)) { return float.IsNaN(_imag); } return true; } public bool IsInfinity() { if (!float.IsInfinity(_real)) { return float.IsInfinity(_imag); } return true; } public bool IsReal() { return _imag == 0f; } public bool IsRealNonNegative() { if (_imag == 0f) { return _real >= 0f; } return false; } public Complex32 Exponential() { float num = (float)Math.Exp(_real); if (IsReal()) { return new Complex32(num, 0f); } return new Complex32(num * (float)Math.Cos(_imag), num * (float)Math.Sin(_imag)); } public Complex32 NaturalLogarithm() { if (IsRealNonNegative()) { return new Complex32((float)Math.Log(_real), 0f); } return new Complex32(0.5f * (float)Math.Log(MagnitudeSquared), Phase); } public Complex32 CommonLogarithm() { return NaturalLogarithm() / 2.3025851f; } public Complex32 Logarithm(float baseValue) { return NaturalLogarithm() / (float)Math.Log(baseValue); } public Complex32 Power(Complex32 exponent) { if (IsZero()) { if (exponent.IsZero()) { return One; } if (exponent.Real > 0f) { return Zero; } if (exponent.Real < 0f) { if (exponent.Imaginary != 0f) { return new Complex32(float.PositiveInfinity, float.PositiveInfinity); } return new Complex32(float.PositiveInfinity, 0f); } return NaN; } return (exponent * NaturalLogarithm()).Exponential(); } public Complex32 Root(Complex32 rootExponent) { return Power(1f / rootExponent); } public Complex32 Square() { if (IsReal()) { return new Complex32(_real * _real, 0f); } return new Complex32(_real * _real - _imag * _imag, 2f * _real * _imag); } public Complex32 SquareRoot() { if (IsRealNonNegative()) { return new Complex32((float)Math.Sqrt(_real), 0f); } float num = Math.Abs(Real); float num2 = Math.Abs(Imaginary); double num4; if (num >= num2) { float num3 = Imaginary / Real; num4 = Math.Sqrt(num) * Math.Sqrt(0.5 * (1.0 + Math.Sqrt(1f + num3 * num3))); } else { float num5 = Real / Imaginary; num4 = Math.Sqrt(num2) * Math.Sqrt(0.5 * ((double)Math.Abs(num5) + Math.Sqrt(1f + num5 * num5))); } return (Real >= 0f) ? new Complex32((float)num4, (float)((double)Imaginary / (2.0 * num4))) : ((!(Imaginary >= 0f)) ? new Complex32((float)((double)num2 / (2.0 * num4)), (float)(0.0 - num4)) : new Complex32((float)((double)num2 / (2.0 * num4)), (float)num4)); } public (Complex32, Complex32) SquareRoots() { Complex32 complex = SquareRoot(); return (complex, -complex); } public (Complex32, Complex32, Complex32) CubicRoots() { float magnitude = (float)Math.Pow(Magnitude, 1.0 / 3.0); float num = Phase / 3f; return (FromPolarCoordinates(magnitude, num), FromPolarCoordinates(magnitude, num + MathF.PI * 2f / 3f), FromPolarCoordinates(magnitude, num - MathF.PI * 2f / 3f)); } public static bool operator ==(Complex32 complex1, Complex32 complex2) { return complex1.Equals(complex2); } public static bool operator !=(Complex32 complex1, Complex32 complex2) { return !complex1.Equals(complex2); } public static Complex32 operator +(Complex32 summand) { return summand; } public static Complex32 operator -(Complex32 subtrahend) { return new Complex32(0f - subtrahend._real, 0f - subtrahend._imag); } public static Complex32 operator +(Complex32 summand1, Complex32 summand2) { return new Complex32(summand1._real + summand2._real, summand1._imag + summand2._imag); } public static Complex32 operator -(Complex32 minuend, Complex32 subtrahend) { return new Complex32(minuend._real - subtrahend._real, minuend._imag - subtrahend._imag); } public static Complex32 operator +(Complex32 summand1, float summand2) { return new Complex32(summand1._real + summand2, summand1._imag); } public static Complex32 operator -(Complex32 minuend, float subtrahend) { return new Complex32(minuend._real - subtrahend, minuend._imag); } public static Complex32 operator +(float summand1, Complex32 summand2) { return new Complex32(summand2._real + summand1, summand2._imag); } public static Complex32 operator -(float minuend, Complex32 subtrahend) { return new Complex32(minuend - subtrahend._real, 0f - subtrahend._imag); } public static Complex32 operator *(Complex32 multiplicand, Complex32 multiplier) { return new Complex32(multiplicand._real * multiplier._real - multiplicand._imag * multiplier._imag, multiplicand._real * multiplier._imag + multiplicand._imag * multiplier._real); } public static Complex32 operator *(float multiplicand, Complex32 multiplier) { return new Complex32(multiplier._real * multiplicand, multiplier._imag * multiplicand); } public static Complex32 operator *(Complex32 multiplicand, float multiplier) { return new Complex32(multiplicand._real * multiplier, multiplicand._imag * multiplier); } public static Complex32 operator /(Complex32 dividend, Complex32 divisor) { if (dividend.IsZero() && divisor.IsZero()) { return NaN; } if (divisor.IsZero()) { return PositiveInfinity; } float real = dividend.Real; float imaginary = dividend.Imaginary; float real2 = divisor.Real; float imaginary2 = divisor.Imaginary; if (Math.Abs(imaginary2) <= Math.Abs(real2)) { return InternalDiv(real, imaginary, real2, imaginary2, swapped: false); } return InternalDiv(imaginary, real, imaginary2, real2, swapped: true); } private static Complex32 InternalDiv(float a, float b, float c, float d, bool swapped) { float num = d / c; float num2 = 1f / (c + d * num); float real; float num3; if (num != 0f) { real = (a + b * num) * num2; num3 = (b - a * num) * num2; } else { real = (a + d * (b / c)) * num2; num3 = (b - d * (a / c)) * num2; } if (swapped) { num3 = 0f - num3; } return new Complex32(real, num3); } public static Complex32 operator /(float dividend, Complex32 divisor) { if (dividend == 0f && divisor.IsZero()) { return NaN; } if (divisor.IsZero()) { return PositiveInfinity; } float real = divisor.Real; float imaginary = divisor.Imaginary; if (Math.Abs(imaginary) <= Math.Abs(real)) { return InternalDiv(dividend, 0f, real, imaginary, swapped: false); } return InternalDiv(0f, dividend, imaginary, real, swapped: true); } public static Complex32 operator /(Complex32 dividend, float divisor) { if (dividend.IsZero() && divisor == 0f) { return NaN; } if (divisor == 0f) { return PositiveInfinity; } return new Complex32(dividend._real / divisor, dividend._imag / divisor); } public Complex32 Conjugate() { return new Complex32(_real, 0f - _imag); } public Complex32 Reciprocal() { if (IsZero()) { return Zero; } return 1f / this; } public override string ToString() { return string.Format(CultureInfo.CurrentCulture, "({0}, {1})", _real, _imag); } public string ToString(string format) { CultureInfo currentCulture = CultureInfo.CurrentCulture; float real = _real; string arg = real.ToString(format, CultureInfo.CurrentCulture); real = _imag; return string.Format(currentCulture, "({0}, {1})", arg, real.ToString(format, CultureInfo.CurrentCulture)); } public string ToString(IFormatProvider provider) { return string.Format(provider, "({0}, {1})", _real, _imag); } public string ToString(string format, IFormatProvider provider) { float real = _real; string arg = real.ToString(format, provider); real = _imag; return string.Format(provider, "({0}, {1})", arg, real.ToString(format, provider)); } public bool Equals(Complex32 other) { if (IsNaN() || other.IsNaN()) { return false; } if (IsInfinity() && other.IsInfinity()) { return true; } if (_real.AlmostEqual(other._real)) { return _imag.AlmostEqual(other._imag); } return false; } public override int GetHashCode() { int num = 27; int num2 = 13 * num; float real = _real; num = num2 + real.GetHashCode(); int num3 = 13 * num; real = _imag; return num3 + real.GetHashCode(); } public override bool Equals(object obj) { if (obj is Complex32 other) { return Equals(other); } return false; } public static Complex32 Parse(string value, IFormatProvider formatProvider = null) { if (value == null) { throw new ArgumentNullException("value"); } value = value.Trim(); if (value.Length == 0) { throw new FormatException(); } if (value.StartsWith("(", StringComparison.Ordinal)) { if (!value.EndsWith(")", StringComparison.Ordinal)) { throw new FormatException(); } value = value.Substring(1, value.Length - 2).Trim(); } NumberFormatInfo numberFormatInfo = formatProvider.GetNumberFormatInfo(); TextInfo textInfo = formatProvider.GetTextInfo(); string[] keywords = new string[8] { textInfo.ListSeparator, numberFormatInfo.NaNSymbol, numberFormatInfo.NegativeInfinitySymbol, numberFormatInfo.PositiveInfinitySymbol, "+", "-", "i", "j" }; LinkedList<string> linkedList = new LinkedList<string>(); GlobalizationHelper.Tokenize(linkedList.AddFirst(value), keywords, 0); LinkedListNode<string> token = linkedList.First; bool imaginary; float num = ParsePart(ref token, out imaginary, formatProvider); if (token == null) { if (!imaginary) { return new Complex32(num, 0f); } return new Complex32(0f, num); } if (token.Value == textInfo.ListSeparator) { token = token.Next; if (imaginary) { throw new FormatException(); } bool imaginary2; float imaginary3 = ParsePart(ref token, out imaginary2, formatProvider); return new Complex32(num, imaginary3); } bool imaginary4; float num2 = ParsePart(ref token, out imaginary4, formatProvider); if (!(imaginary ^ imaginary4)) { throw new FormatException(); } if (!imaginary) { return new Complex32(num, num2); } return new Complex32(num2, num); } private static float ParsePart(ref LinkedListNode<string> token, out bool imaginary, IFormatProvider format) { imaginary = false; if (token == null) { throw new FormatException(); } if (token.Value == "+") { token = token.Next; if (token == null) { throw new FormatException(); } } bool flag = false; if (token.Value == "-") { flag = true; token = token.Next; if (token == null) { throw new FormatException(); } } if (string.Compare(token.Value, "i", StringComparison.OrdinalIgnoreCase) == 0 || string.Compare(token.Value, "j", StringComparison.OrdinalIgnoreCase) == 0) { imaginary = true; token = token.Next; if (token == null) { return (!flag) ? 1 : (-1); } } float num = GlobalizationHelper.ParseSingle(ref token, format.GetCultureInfo()); if (token != null && (string.Compare(token.Value, "i", StringComparison.OrdinalIgnoreCase) == 0 || string.Compare(token.Value, "j", StringComparison.OrdinalIgnoreCase) == 0)) { if (imaginary) { throw new FormatException(); } imaginary = true; token = token.Next; } if (!flag) { return num; } return 0f - num; } public static bool TryParse(string value, out Complex32 result) { return TryParse(value, null, out result); } public static bool TryParse(string value, IFormatProvider formatProvider, out Complex32 result) { try { result = Parse(value, formatProvider); return true; } catch (ArgumentNullException) { result = Zero; return false; } catch (FormatException) { result = Zero; return false; } } public static explicit operator Complex32(decimal value) { return new Complex32((float)value, 0f); } public static explicit operator Complex32(Complex value) { return new Complex32((float)value.Real, (float)value.Imaginary); } public static implicit operator Complex32(byte value) { return new Complex32((int)value, 0f); } public static implicit operator Complex32(short value) { return new Complex32(value, 0f); } [CLSCompliant(false)] public static implicit operator Complex32(sbyte value) { return new Complex32(value, 0f); } [CLSCompliant(false)] public static implicit operator Complex32(ushort value) { return new Complex32((int)value, 0f); } public static implicit operator Complex32(int value) { return new Complex32(value, 0f); } public static implicit operator Complex32(BigInteger value) { return new Complex32((long)value, 0f); } public static implicit operator Complex32(long value) { return new Complex32(value, 0f); } [CLSCompliant(false)] public static implicit operator Complex32(uint value) { return new Complex32(value, 0f); } [CLSCompliant(false)] public static implicit operator Complex32(ulong value) { return new Complex32(value, 0f); } public static implicit operator Complex32(float value) { return new Complex32(value, 0f); } public static explicit operator Complex32(double value) { return new Complex32((float)value, 0f); } public Complex ToComplex() { return new Complex(_real, _imag); } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static Complex32 Negate(Complex32 value) { return -value; } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static Complex32 Conjugate(Complex32 value) { return value.Conjugate(); } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static Complex32 Add(Complex32 left, Complex32 right) { return left + right; } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static Complex32 Subtract(Complex32 left, Complex32 right) { return left - right; } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static Complex32 Multiply(Complex32 left, Complex32 right) { return left * right; } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static Complex32 Divide(Complex32 dividend, Complex32 divisor) { return dividend / divisor; } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static Complex32 Reciprocal(Complex32 value) { return value.Reciprocal(); } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static Complex32 Sqrt(Complex32 value) { return value.SquareRoot(); } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static double Abs(Complex32 value) { return value.Magnitude; } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static Complex32 Exp(Complex32 value) { return value.Exponential(); } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static Complex32 Pow(Complex32 value, Complex32 power) { return value.Power(power); } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static Complex32 Pow(Complex32 value, float power) { return value.Power(power); } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static Complex32 Log(Complex32 value) { return value.NaturalLogarithm(); } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static Complex32 Log(Complex32 value, float baseValue) { return value.Logarithm(baseValue); } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static Complex32 Log10(Complex32 value) { return value.CommonLogarithm(); } public static Complex32 Sin(Complex32 value) { return (Complex32)value.ToComplex().Sin(); } public static Complex32 Cos(Complex32 value) { return (Complex32)value.ToComplex().Cos(); } public static Complex32 Tan(Complex32 value) { return (Complex32)value.ToComplex().Tan(); } public static Complex32 Asin(Complex32 value) { return (Complex32)value.ToComplex().Asin(); } public static Complex32 Acos(Complex32 value) { return (Complex32)value.ToComplex().Acos(); } public static Complex32 Atan(Complex32 value) { return (Complex32)value.ToComplex().Atan(); } public static Complex32 Sinh(Complex32 value) { return (Complex32)value.ToComplex().Sinh(); } public static Complex32 Cosh(Complex32 value) { return (Complex32)value.ToComplex().Cosh(); } public static Complex32 Tanh(Complex32 value) { return (Complex32)value.ToComplex().Tanh(); } } public static class ComplexExtensions { public static double MagnitudeSquared(this Complex32 complex) { return complex.Real * complex.Real + complex.Imaginary * complex.Imaginary; } public static double MagnitudeSquared(this Complex complex) { return complex.Real * complex.Real + complex.Imaginary * complex.Imaginary; } public static Complex Sign(this Complex complex) { if (double.IsPositiveInfinity(complex.Real) && double.IsPositiveInfinity(complex.Imaginary)) { return new Complex(0.7071067811865476, 0.7071067811865476); } if (double.IsPositiveInfinity(complex.Real) && double.IsNegativeInfinity(complex.Imaginary)) { return new Complex(0.7071067811865476, -0.7071067811865476); } if (double.IsNegativeInfinity(complex.Real) && double.IsPositiveInfinity(complex.Imaginary)) { return new Complex(-0.7071067811865476, -0.7071067811865476); } if (double.IsNegativeInfinity(complex.Real) && double.IsNegativeInfinity(complex.Imaginary)) { return new Complex(-0.7071067811865476, 0.7071067811865476); } double num = SpecialFunctions.Hypotenuse(complex.Real, complex.Imaginary); if (num == 0.0) { return Complex.Zero; } return new Complex(complex.Real / num, complex.Imaginary / num); } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static Complex Conjugate(this Complex complex) { return Complex.Conjugate(complex); } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static Complex Reciprocal(this Complex complex) { return Complex.Reciprocal(complex); } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static Complex Exp(this Complex complex) { return Complex.Exp(complex); } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static Complex Ln(this Complex complex) { return Complex.Log(complex); } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static Complex Log10(this Complex complex) { return Complex.Log10(complex); } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static Complex Log(this Complex complex, double baseValue) { return Complex.Log(complex, baseValue); } public static Complex Power(this Complex complex, Complex exponent) { if (complex.IsZero()) { if (exponent.IsZero()) { return Complex.One; } if (exponent.Real > 0.0) { return Complex.Zero; } if (exponent.Real < 0.0) { if (exponent.Imaginary != 0.0) { return new Complex(double.PositiveInfinity, double.PositiveInfinity); } return new Complex(double.PositiveInfinity, 0.0); } return new Complex(double.NaN, double.NaN); } return Complex.Pow(complex, exponent); } public static Complex Root(this Complex complex, Complex rootExponent) { return Complex.Pow(complex, (Complex)1 / rootExponent); } public static Complex Square(this Complex complex) { if (complex.IsReal()) { return new Complex(complex.Real * complex.Real, 0.0); } return new Complex(complex.Real * complex.Real - complex.Imaginary * complex.Imaginary, 2.0 * complex.Real * complex.Imaginary); } public static Complex SquareRoot(this Complex complex) { if (complex.IsRealNonNegative()) { return new Complex(Math.Sqrt(complex.Real), 0.0); } double num = Math.Abs(complex.Real); double num2 = Math.Abs(complex.Imaginary); double num4; if (num >= num2) { double num3 = complex.Imaginary / complex.Real; num4 = Math.Sqrt(num) * Math.Sqrt(0.5 * (1.0 + Math.Sqrt(1.0 + num3 * num3))); } else { double num5 = complex.Real / complex.Imaginary; num4 = Math.Sqrt(num2) * Math.Sqrt(0.5 * (Math.Abs(num5) + Math.Sqrt(1.0 + num5 * num5))); } return (complex.Real >= 0.0) ? new Complex(num4, complex.Imaginary / (2.0 * num4)) : ((!(complex.Imaginary >= 0.0)) ? new Complex(num2 / (2.0 * num4), 0.0 - num4) : new Complex(num2 / (2.0 * num4), num4)); } public static (Complex, Complex) SquareRoots(this Complex complex) { Complex complex2 = complex.SquareRoot(); return (complex2, -complex2); } public static (Complex, Complex, Complex) CubicRoots(this Complex complex) { double magnitude = Math.Pow(complex.Magnitude, 1.0 / 3.0); double num = complex.Phase / 3.0; return (Complex.FromPolarCoordinates(magnitude, num), Complex.FromPolarCoordinates(magnitude, num + Math.PI * 2.0 / 3.0), Complex.FromPolarCoordinates(magnitude, num - Math.PI * 2.0 / 3.0)); } public static bool IsZero(this Complex complex) { if (complex.Real == 0.0) { return complex.Imaginary == 0.0; } return false; } public static bool IsOne(this Complex complex) { if (complex.Real == 1.0) { return complex.Imaginary == 0.0; } return false; } public static bool IsImaginaryOne(this Complex complex) { if (complex.Real == 0.0) { return complex.Imaginary == 1.0; } return false; } public static bool IsNaN(this Complex complex) { if (!double.IsNaN(complex.Real)) { return double.IsNaN(complex.Imaginary); } return true; } public static bool IsInfinity(this Complex complex) { if (!double.IsInfinity(complex.Real)) { return double.IsInfinity(complex.Imaginary); } return true; } public static bool IsReal(this Complex complex) { return complex.Imaginary == 0.0; } public static bool IsRealNonNegative(this Complex complex) { if (complex.Imaginary == 0.0) { return complex.Real >= 0.0; } return false; } public static double Norm(this Complex complex) { return complex.MagnitudeSquared(); } public static double Norm(this Complex32 complex) { return complex.MagnitudeSquared; } public static double NormOfDifference(this Complex complex, Complex otherValue) { return (complex - otherValue).MagnitudeSquared(); } public static double NormOfDifference(this Complex32 complex, Complex32 otherValue) { return (complex - otherValue).MagnitudeSquared; } public static Complex ToComplex(this string value) { return value.ToComplex(null); } public static Complex ToComplex(this string value, IFormatProvider formatProvider) { if (value == null) { throw new ArgumentNullException("value"); } value = value.Trim(); if (value.Length == 0) { throw new FormatException(); } if (value.StartsWith("(", StringComparison.Ordinal)) { if (!value.EndsWith(")", StringComparison.Ordinal)) { throw new FormatException(); } value = value.Substring(1, value.Length - 2).Trim(); } NumberFormatInfo numberFormatInfo = formatProvider.GetNumberFormatInfo(); TextInfo textInfo = formatProvider.GetTextInfo(); string[] keywords = new string[8] { textInfo.ListSeparator, numberFormatInfo.NaNSymbol, numberFormatInfo.NegativeInfinitySymbol, numberFormatInfo.PositiveInfinitySymbol, "+", "-", "i", "j" }; LinkedList<string> linkedList = new LinkedList<string>(); GlobalizationHelper.Tokenize(linkedList.AddFirst(value), keywords, 0); LinkedListNode<string> token = linkedList.First; bool imaginary; double num = ParsePart(ref token, out imaginary, formatProvider); if (token == null) { if (!imaginary) { return new Complex(num, 0.0); } return new Complex(0.0, num); } if (token.Value == textInfo.ListSeparator) { token = token.Next; if (imaginary) { throw new FormatException(); } bool imaginary2; double imaginary3 = ParsePart(ref token, out imaginary2, formatProvider); return new Complex(num, imaginary3); } bool imaginary4; double num2 = ParsePart(ref token, out imaginary4, formatProvider); if (!(imaginary ^ imaginary4)) { throw new FormatException(); } if (!imaginary) { return new Complex(num, num2); } return new Complex(num2, num); } private static double ParsePart(ref LinkedListNode<string> token, out bool imaginary, IFormatProvider format) { imaginary = false; if (token == null) { throw new FormatException(); } if (token.Value == "+") { token = token.Next; if (token == null) { throw new FormatException(); } } bool flag = false; if (token.Value == "-") { flag = true; token = token.Next; if (token == null) { throw new FormatException(); } } if (string.Compare(token.Value, "i", StringComparison.OrdinalIgnoreCase) == 0 || string.Compare(token.Value, "j", StringComparison.OrdinalIgnoreCase) == 0) { imaginary = true; token = token.Next; if (token == null) { return (!flag) ? 1 : (-1); } } double num = GlobalizationHelper.ParseDouble(ref token, format.GetCultureInfo()); if (token != null && (string.Compare(token.Value, "i", StringComparison.OrdinalIgnoreCase) == 0 || string.Compare(token.Value, "j", StringComparison.OrdinalIgnoreCase) == 0)) { if (imaginary) { throw new FormatException(); } imaginary = true; token = token.Next; } if (!flag) { return num; } return 0.0 - num; } public static bool TryToComplex(this string value, out Complex result) { return value.TryToComplex(null, out result); } public static bool TryToComplex(this string value, IFormatProvider formatProvider, out Complex result) { try { result = value.ToComplex(formatProvider); return true; } catch (ArgumentNullException) { result = Complex.Zero; return false; } catch (FormatException) { result = Complex.Zero; return false; } } public static Complex32 ToComplex32(this string value) { return Complex32.Parse(value); } public static Complex32 ToComplex32(this string value, IFormatProvider formatProvider) { return Complex32.Parse(value, formatProvider); } public static bool TryToComplex32(this string value, out Complex32 result) { return Complex32.TryParse(value, out result); } public static bool TryToComplex32(this string value, IFormatProvider formatProvider, out Complex32 result) { return Complex32.TryParse(value, formatProvider, out result); } } public static class Constants { public const double E = Math.E; public const double Log2E = 1.4426950408889634; public const double Log10E = 0.4342944819032518; public const double Ln2 = 0.6931471805599453; public const double Ln10 = 2.302585092994046; public const double LnPi = 1.1447298858494002; public const double Ln2PiOver2 = 0.9189385332046728; public const double InvE = 1.0 / Math.E; public const double SqrtE = 1.6487212707001282; public const double Sqrt2 = 1.4142135623730951; public const double Sqrt3 = 1.7320508075688772; public const double Sqrt1Over2 = 0.7071067811865476; public const double HalfSqrt3 = 0.8660254037844386; public const double Pi = Math.PI; public const double Pi2 = Math.PI * 2.0; public const double PiOver2 = Math.PI / 2.0; public const double Pi3Over2 = 4.71238898038469; public const double PiOver4 = Math.PI / 4.0; public const double SqrtPi = 1.772453850905516; public const double Sqrt2Pi = 2.5066282746310007; public const double SqrtPiOver2 = 1.2533141373155003; public const double Sqrt2PiE = 4.132731354122493; public const double LogSqrt2Pi = 0.9189385332046728; public const double LogSqrt2PiE = 1.4189385332046727; public const double LogTwoSqrtEOverPi = 0.6207822376352452; public const double InvPi = 1.0 / Math.PI; public const double TwoInvPi = 2.0 / Math.PI; public const double InvSqrtPi = 0.5641895835477563; public const double InvSqrt2Pi = 0.3989422804014327; public const double TwoInvSqrtPi = 1.1283791670955126; public const double TwoSqrtEOverPi = 1.8603827342052657; public const double Degree = Math.PI / 180.0; public const double Grad = Math.PI / 200.0; public const double PowerDecibel = 0.11512925464970228; public const double NeutralDecibel = 0.23025850929940456; public const double Catalan = 0.915965594177219; public const double EulerMascheroni = 0.5772156649015329; public const double GoldenRatio = 1.618033988749895; public const double Glaisher = 1.2824271291006226; public const double Khinchin = 2.6854520010653062; public const int SizeOfDouble = 8; public const int SizeOfInt = 4; public const int SizeOfFloat = 4; public const int SizeOfComplex = 16; public const int SizeOfComplex32 = 8; public const double SpeedOfLight = 299792458.0; public const double MagneticPermeability = 1.2566370614359173E-06; public const double ElectricPermittivity = 8.854187817193708E-12; public const double CharacteristicImpedanceVacuum = 376.73031346177066; public const double GravitationalConstant = 6.67429E-11; public const double PlancksConstant = 6.62606896E-34; public const double DiracsConstant = 1.054571629E-34; public const double PlancksMass = 2.17644E-08; public const double PlancksTemperature = 1.416786E+32; public const double PlancksLength = 1.616253E-35; public const double PlancksTime = 5.39124E-44; public const double ElementaryCharge = 1.602176487E-19; public const double MagneticFluxQuantum = 2.067833668E-15; public const double ConductanceQuantum = 7.7480917005E-05; public const double JosephsonConstant = 483597891000000.0; public const double VonKlitzingConstant = 25812.807557; public const double BohrMagneton = 9.27400915E-24; public const double NuclearMagneton = 5.05078324E-27; public const double FineStructureConstant = 0.0072973525376; public const double RydbergConstant = 10973731.568528; public const double BohrRadius = 5.2917720859E-11; public const double HartreeEnergy = 4.35974394E-18; public const double QuantumOfCirculation = 0.00036369475199; public const double FermiCouplingConstant = 1.16637E-05; public const double WeakMixingAngle = 0.22256; public const double ElectronMass = 9.10938215E-31; public const double ElectronMassEnergyEquivalent = 8.18710438E-14; public const double ElectronMolarMass = 5.4857990943E-07; public const double ComptonWavelength = 2.4263102175E-12; public const double ClassicalElectronRadius = 2.8179402894E-15; public const double ThomsonCrossSection = 6.652458558E-29; public const double ElectronMagneticMoment = -9.28476377E-24; public const double ElectronGFactor = -2.0023193043622; public const double MuonMass = 1.8835313E-28; public const double MuonMassEnegryEquivalent = 1.692833511E-11; public const double MuonMolarMass = 0.0001134289256; public const double MuonComptonWavelength = 1.173444104E-14; public const double MuonMagneticMoment = -4.49044786E-26; public const double MuonGFactor = -2.0023318414; public const double TauMass = 3.16777E-27; public const double TauMassEnergyEquivalent = 2.84705E-10; public const double TauMolarMass = 0.00190768; public const double TauComptonWavelength = 6.9772E-16; public const double ProtonMass = 1.672621637E-27; public const double ProtonMassEnergyEquivalent = 1.503277359E-10; public const double ProtonMolarMass = 0.00100727646677; public const double ProtonComptonWavelength = 1.3214098446E-15; public const double ProtonMagneticMoment = 1.410606662E-26; public const double ProtonGFactor = 5.585694713; public const double ShieldedProtonMagneticMoment = 1.410570419E-26; public const double ProtonGyromagneticRatio = 267522209.9; public const double ShieldedProtonGyromagneticRatio = 267515336.2; public const double NeutronMass = 1.674927212E-27; public const double NeutronMassEnegryEquivalent = 1.505349506E-10; public const double NeutronMolarMass = 0.00100866491597; public const double NeutronComptonWavelength = 0.13195908951; public const double NeutronMagneticMoment = -9.6623641E-27; public const double NeutronGFactor = -3.82608545; public const double NeutronGyromagneticRatio = 183247185.0; public const double DeuteronMass = 3.3435832E-27; public const double DeuteronMassEnegryEquivalent = 3.00506272E-10; public const double DeuteronMolarMass = 0.002013553212725; public const double DeuteronMagneticMoment = 4.33073465E-27; public const double HelionMass = 5.00641192E-27; public const double HelionMassEnegryEquivalent = 4.49953864E-10; public const double HelionMolarMass = 0.0030149322473; public const double Avogadro = 6.0221412927E+23; public const double Yotta = 1E+24; public const double Zetta = 1E+21; public const double Exa = 1E+18; public const double Peta = 1000000000000000.0; public const double Tera = 1000000000000.0; public const double Giga = 1000000000.0; public const double Mega = 1000000.0; public const double Kilo = 1000.0; public const double Hecto = 100.0; public const double Deca = 10.0; public const double Deci = 0.1; public const double Centi = 0.01; public const double Milli = 0.001; public const double Micro = 1E-06; public const double Nano = 1E-09; public const double Pico = 1E-12; public const double Femto = 1E-15; public const double Atto = 1E-18; public const double Zepto = 1E-21; public const double Yocto = 1E-24; } public static class Control { private static int _maxDegreeOfParallelism; private static int _parallelizeOrder; private static int _parallelizeElements; private static string _nativeProviderHintPath; public static bool CheckDistributionParameters { get; set; } public static bool ThreadSafeRandomNumberGenerators { get; set; } public static string NativeProviderPath { get { return _nativeProviderHintPath; } set { _nativeProviderHintPath = value; LinearAlgebraControl.HintPath = value; FourierTransformControl.HintPath = value; SparseSolverControl.HintPath = value; } } public static int MaxDegreeOfParallelism { get { return _maxDegreeOfParallelism; } set { _maxDegreeOfParallelism = Math.Max(1, Math.Min(1024, value)); LinearAlgebraControl.Provider.InitializeVerify(); FourierTransformControl.Provider.InitializeVerify(); SparseSolverControl.Provider.InitializeVerify(); } } public static TaskScheduler TaskScheduler { get; set; } internal static int ParallelizeOrder { get { return _parallelizeOrder; } set { _parallelizeOrder = Math.Max(3, value); } } internal static int ParallelizeElements { get { return _parallelizeElements; } set { _parallelizeElements = Math.Max(3, value); } } static Control() { ConfigureAuto(); } public static void ConfigureAuto() { CheckDistributionParameters = true; ThreadSafeRandomNumberGenerators = true; _maxDegreeOfParallelism = Environment.ProcessorCount; _parallelizeOrder = 64; _parallelizeElements = 300; TaskScheduler = TaskScheduler.Default; } public static void UseManaged() { LinearAlgebraControl.UseManaged(); FourierTransformControl.UseManaged(); SparseSolverControl.UseManaged(); } public static void UseDefaultProviders() { if (AppSwitches.DisableNativeProviders) { UseManaged(); return; } LinearAlgebraControl.UseDefault(); FourierTransformControl.UseDefault(); SparseSolverControl.UseDefault(); } public static void UseBestProviders() { if (AppSwitches.DisableNativeProviders || AppSwitches.DisableNativeProviderProbing) { UseManaged(); return; } LinearAlgebraControl.UseBest(); FourierTransformControl.UseBest(); SparseSolverControl.UseBest(); } public static void UseNativeMKL() { LinearAlgebraControl.UseNativeMKL(); FourierTransformControl.UseNativeMKL(); SparseSolverControl.UseNativeMKL(); } public static bool TryUseNativeMKL() { bool num = LinearAlgebraControl.TryUseNativeMKL(); bool flag = FourierTransformControl.TryUseNativeMKL(); bool flag2 = SparseSolverControl.TryUseNativeMKL(); return num || flag || flag2; } public static void UseNativeCUDA() { LinearAlgebraControl.UseNativeCUDA(); } public static bool TryUseNativeCUDA() { return LinearAlgebraControl.TryUseNativeCUDA(); } public static void UseNativeOpenBLAS() { LinearAlgebraControl.UseNativeOpenBLAS(); } public static bool TryUseNativeOpenBLAS() { return LinearAlgebraControl.TryUseNativeOpenBLAS(); } public static bool TryUseNative() { if (AppSwitches.DisableNativeProviders || AppSwitches.DisableNativeProviderProbing) { return false; } bool num = LinearAlgebraControl.TryUseNative(); bool flag = FourierTransformControl.TryUseNative(); bool flag2 = SparseSolverControl.TryUseNative(); return num || flag || flag2; } public static void FreeResources() { LinearAlgebraControl.FreeResources(); FourierTransformControl.FreeResources(); SparseSolverControl.FreeResources(); } public static void UseSingleThread() { _maxDegreeOfParallelism = 1; ThreadSafeRandomNumberGenerators = false; LinearAlgebraControl.Provider.InitializeVerify(); FourierTransformControl.Provider.InitializeVerify(); SparseSolverControl.Provider.InitializeVerify(); } public static void UseMultiThreading() { _maxDegreeOfParallelism = Environment.ProcessorCount; ThreadSafeRandomNumberGenerators = true; LinearAlgebraControl.Provider.InitializeVerify(); FourierTransformControl.Provider.InitializeVerify(); SparseSolverControl.Provider.InitializeVerify(); } public static string Describe() { AssemblyInformationalVersionAttribute assemblyInformationalVersionAttribute = typeof(Control).GetTypeInfo().Assembly.GetCustomAttribute(typeof(AssemblyInformationalVersionAttribute)) as AssemblyInformationalVersionAttribute; StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendLine("Math.NET Numerics Configuration:"); stringBuilder.AppendLine("Version " + assemblyInformationalVersionAttribute?.InformationalVersion); stringBuilder.AppendLine("Built for .NET Standard 2.0"); stringBuilder.AppendLine($"Linear Algebra Provider: {LinearAlgebraControl.Provider}"); stringBuilder.AppendLine($"Fourier Transform Provider: {FourierTransformControl.Provider}"); stringBuilder.AppendLine($"Sparse Solver Provider: {SparseSolverControl.Provider}"); stringBuilder.AppendLine($"Max Degree of Parallelism: {MaxDegreeOfParallelism}"); stringBuilder.AppendLine($"Parallelize Elements: {ParallelizeElements}"); stringBuilder.AppendLine($"Parallelize Order: {ParallelizeOrder}"); stringBuilder.AppendLine($"Check Distribution Parameters: {CheckDistributionParameters}"); stringBuilder.AppendLine($"Thread-Safe RNGs: {ThreadSafeRandomNumberGenerators}"); stringBuilder.AppendLine("Operating System: " + RuntimeInformation.OSDescription); stringBuilder.AppendLine($"Operating System Architecture: {RuntimeInformation.OSArchitecture}"); stringBuilder.AppendLine("Framework: " + RuntimeInformation.FrameworkDescription); stringBuilder.AppendLine($"Process Architecture: {RuntimeInformation.ProcessArchitecture}"); string environmentVariable = Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE"); if (!string.IsNullOrEmpty(environmentVariable)) { stringBuilder.AppendLine("Processor Architecture: " + environmentVariable); } string environmentVariable2 = Environment.GetEnvironmentVariable("PROCESSOR_IDENTIFIER"); if (!string.IsNullOrEmpty(environmentVariable2)) { stringBuilder.AppendLine("Processor Identifier: " + environmentVariable2); } return stringBuilder.ToString(); } } public static class Differentiate { public static NumericalDerivative Points(int points, int center) { return new NumericalDerivative(points, center); } public static NumericalDerivative Order(int order) { int num = order + (order.IsEven() ? 1 : 2); return new NumericalDerivative(num, num / 2); } public static double Derivative(Func<double, double> f, double x, int order) { return Order(order).EvaluateDerivative(f, x, order); } public static Func<double, double> DerivativeFunc(Func<double, double> f, int order) { return Order(order).CreateDerivativeFunctionHandle(f, order); } public static double FirstDerivative(Func<double, double> f, double x) { return Order(1).EvaluateDerivative(f, x, 1); } public static Func<double, double> FirstDerivativeFunc(Func<double, double> f) { return Order(1).CreateDerivativeFunctionHandle(f, 1); } public static double SecondDerivative(Func<double, double> f, double x) { return Order(2).EvaluateDerivative(f, x, 2); } public static Func<double, double> SecondDerivativeFunc(Func<double, double> f) { return Order(2).CreateDerivativeFunctionHandle(f, 2); } public static double PartialDerivative(Func<double[], double> f, double[] x, int parameterIndex, int order) { return Order(order).EvaluatePartialDerivative(f, x, parameterIndex, order); } public static Func<double[], double> PartialDerivativeFunc(Func<double[], double> f, int parameterIndex, int order) { return Order(order).CreatePartialDerivativeFunctionHandle(f, parameterIndex, order); } public static double FirstPartialDerivative(Func<double[], double> f, double[] x, int parameterIndex) { return PartialDerivative(f, x, parameterIndex, 1); } public static Func<double[], double> FirstPartialDerivativeFunc(Func<double[], double> f, int parameterIndex) { return PartialDerivativeFunc(f, parameterIndex, 1); } public static double PartialDerivative2(Func<double, double, double> f, double x, double y, int parameterIndex, int order) { return Order(order).EvaluatePartialDerivative((double[] array) => f(array[0], array[1]), new double[2] { x, y }, parameterIndex, order); } public static Func<double, double, double> PartialDerivative2Func(Func<double, double, double> f, int parameterIndex, int order) { Func<double[], double> handle = Order(order).CreatePartialDerivativeFunctionHandle((double[] array) => f(array[0], array[1]), parameterIndex, order); return (double x, double y) => handle(new double[2] { x, y }); } public static double FirstPartialDerivative2(Func<double, double, double> f, double x, double y, int parameterIndex) { return PartialDerivative2(f, x, y, parameterIndex, 1); } public static Func<double, double, double> FirstPartialDerivative2Func(Func<double, double, double> f, int parameterIndex) { return PartialDerivative2Func(f, parameterIndex, 1); } } public static class DifferIntegrate { public static double DoubleExponential(Func<double, double> f, double x, double order, double x0 = 0.0, double targetAbsoluteError = 1E-10) { if (Math.Abs(order) < double.Epsilon) { return f(x); } if (order > 0.0 && Math.Abs(order - (double)(int)order) < double.Epsilon) { return Differentiate.Derivative(f, x, (int)order); } int num = (int)Math.Ceiling(order) + 1; if (num < 1) { num = 1; } double r = (double)num - order - 1.0; double num2 = Differentiate.Derivative((double v) => Integrate.DoubleExponential((double t) => Math.Pow(v - t, r) * f(t), x0, v, targetAbsoluteError), x, num); double num3 = SpecialFunctions.Gamma((double)num - order); return num2 / num3; } public static double GaussLegendre(Func<double, double> f, double x, double order, double x0 = 0.0, int gaussLegendrePoints = 128) { if (Math.Abs(order) < double.Epsilon) { return f(x); } if (order > 0.0 && Math.Abs(order - (double)(int)order) < double.Epsilon) { return Differentiate.Derivative(f, x, (int)order); } int num = (int)Math.Ceiling(order) + 1; if (num < 1) { num = 1; } double r = (double)num - order - 1.0; double num2 = Differentiate.Derivative((double v) => Integrate.GaussLegendre((double t) => Math.Pow(v - t, r) * f(t), x0, v, gaussLegendrePoints), x, num); double num3 = SpecialFunctions.Gamma((double)num - order); return num2 / num3; } public static double GaussKronrod(Func<double, double> f, double x, double order, double x0 = 0.0, double targetRelativeError = 1E-10, int gaussKronrodPoints = 15) { if (Math.Abs(order) < double.Epsilon) { return f(x); } if (order > 0.0 && Math.Abs(order - (double)(int)order) < double.Epsilon) { return Differentiate.Derivative(f, x, (int)order); } int num = (int)Math.Ceiling(order) + 1; if (num < 1) { num = 1; } double r = (double)num - order - 1.0; double num2 = Differentiate.Derivative((double v) => Integrate.GaussKronrod((double t) => Math.Pow(v - t, r) * f(t), x0, v, targetRelativeError, 15, gaussKronrodPoints), x, num); double num3 = SpecialFunctions.Gamma((double)num - order); return num2 / num3; } } public static class Distance { public static double SAD<T>(MathNet.Numerics.LinearAlgebra.Vector<T> a, MathNet.Numerics.LinearAlgebra.Vector<T> b) where T : struct, IEquatable<T>, IFormattable { return (a - b).L1Norm(); } public static double SAD(double[] a, double[] b) { if (a.Length != b.Length) { throw new ArgumentException("All vectors must have the same dimensionality."); } double num = 0.0; for (int i = 0; i < a.Length; i++) { num += Math.Abs(a[i] - b[i]); } return num; } public static float SAD(float[] a, float[] b) { if (a.Length != b.Length) { throw new ArgumentException("All vectors must have the same dimensionality."); } float num = 0f; for (int i = 0; i < a.Length; i++) { num += Math.Abs(a[i] - b[i]); } return num; } public static double MAE<T>(MathNet.Numerics.LinearAlgebra.Vector<T> a, MathNet.Numerics.LinearAlgebra.Vector<T> b) where T : struct, IEquatable<T>, IFormattable { return (a - b).L1Norm() / (double)a.Count; } public static double MAE(double[] a, double[] b) { return SAD(a, b) / (double)a.Length; } public static float MAE(float[] a, float[] b) { return SAD(a, b) / (float)a.Length; } public static double SSD<T>(MathNet.Numerics.LinearAlgebra.Vector<T> a, MathNet.Numerics.LinearAlgebra.Vector<T> b) where T : struct, IEquatable<T>, IFormattable { double num = (a - b).L2Norm(); return num * num; } public static double SSD(double[] a, double[] b) { if (a.Length != b.Length) { throw new ArgumentException("All vectors must have the same dimensionality."); } double[] array = new double[a.Length]; LinearAlgebraControl.Provider.SubtractArrays(a, b, array); return LinearAlgebraControl.Provider.DotProduct(array, array); } public static float SSD(float[] a, float[] b) { if (a.Length != b.Length) { throw new ArgumentException("All vectors must have the same dimensionality."); } float[] array = new float[a.Length]; LinearAlgebraControl.Provider.SubtractArrays(a, b, array); return LinearAlgebraControl.Provider.DotProduct(array, array); } public static double MSE<T>(MathNet.Numerics.LinearAlgebra.Vector<T> a, MathNet.Numerics.LinearAlgebra.Vector<T> b) where T : struct, IEquatable<T>, IFormattable { double num = (a - b).L2Norm(); return num * num / (double)a.Count; } public static double MSE(double[] a, double[] b) { return SSD(a, b) / (double)a.Length; } public static float MSE(float[] a, float[] b) { return SSD(a, b) / (float)a.Length; } public static double Euclidean<T>(MathNet.Numerics.LinearAlgebra.Vector<T> a, MathNet.Numerics.LinearAlgebra.Vector<T> b) where T : struct, IEquatable<T>, IFormattable { return (a - b).L2Norm(); } public static double Euclidean(double[] a, double[] b) { return Math.Sqrt(SSD(a, b)); } public static float Euclidean(float[] a, float[] b) { return (float)Math.Sqrt(SSD(a, b)); } public static double Manhattan<T>(MathNet.Numerics.LinearAlgebra.Vector<T> a, MathNet.Numerics.LinearAlgebra.Vector<T> b) where T : struct, IEquatable<T>, IFormattable { return (a - b).L1Norm(); } public static double Manhattan(double[] a, double[] b) { return SAD(a, b); } public static float Manhattan(float[] a, float[] b) { return SAD(a, b); } public static double Chebyshev<T>(MathNet.Numerics.LinearAlgebra.Vector<T> a, MathNet.Numerics.LinearAlgebra.Vector<T> b) where T : struct, IEquatable<T>, IFormattable { return (a - b).InfinityNorm(); } public static double Chebyshev(double[] a, double[] b) { if (a.Length != b.Length) { throw new ArgumentException("All vectors must have the same dimensionality."); } double num = Math.Abs(a[0] - b[0]); for (int i = 1; i < a.Length; i++) { double num2 = Math.Abs(a[i] - b[i]); if (num2 > num) { num = num2; } } return num; } public static float Chebyshev(float[] a, float[] b) { if (a.Length != b.Length) { throw new ArgumentException("All vectors must have the same dimensionality."); } float num = Math.Abs(a[0] - b[0]); for (int i = 1; i < a.Length; i++) { float num2 = Math.Abs(a[i] - b[i]); if (num2 > num) { num = num2; } } return num; } public static double Minkowski<T>(double p, MathNet.Numerics.LinearAlgebra.Vector<T> a, MathNet.Numerics.LinearAlgebra.Vector<T> b) where T : struct, IEquatable<T>, IFormattable { return (a - b).Norm(p); } public static double Minkowski(double p, double[] a, double[] b) { if (a.Length != b.Length) { throw new ArgumentException("All vectors must have the same dimensionality."); } if (p < 0.0) { throw new ArgumentOutOfRangeException("p"); } if (p == 1.0) { return Manhattan(a, b); } if (p == 2.0) { return Euclidean(a, b); } if (double.IsPositiveInfinity(p)) { return Chebyshev(a, b); } double num = 0.0; for (int i = 0; i < a.Length; i++) { num += Math.Pow(Math.Abs(a[i] - b[i]), p); } return Math.Pow(num, 1.0 / p); } public static float Minkowski(double p, float[] a, float[] b) { if (a.Length != b.Length) { throw new ArgumentException("All vectors must have the same dimensionality."); } if (p < 0.0) { throw new ArgumentOutOfRangeException("p"); } if (p == 1.0) { return Manhattan(a, b); } if (p == 2.0) { return Euclidean(a, b); } if (double.IsPositiveInfinity(p)) { return Chebyshev(a, b); } double num = 0.0; for (int i = 0; i < a.Length; i++) { num += Math.Pow(Math.Abs(a[i] - b[i]), p); } return (float)Math.Pow(num, 1.0 / p); } public static double Canberra(double[] a, double[] b) { if (a.Length != b.Length) { throw new ArgumentException("All vectors must have the same dimensionality."); } double num = 0.0; for (int i = 0; i < a.Length; i++) { num += Math.Abs(a[i] - b[i]) / (Math.Abs(a[i]) + Math.Abs(b[i])); } return num; } public static float Canberra(float[] a, float[] b) { if (a.Length != b.Length) { throw new ArgumentException("All vectors must have the same dimensionality."); } float num = 0f; for (int i = 0; i < a.Length; i++) { num += Math.Abs(a[i] - b[i]) / (Math.Abs(a[i]) + Math.Abs(b[i])); } return num; } public static double Cosine(double[] a, double[] b) { if (a.Length != b.Length) { throw new ArgumentException("All vectors must have the same dimensionality."); } double num = LinearAlgebraControl.Provider.DotProduct(a, b); double num2 = LinearAlgebraControl.Provider.DotProduct(a, a); double num3 = LinearAlgebraControl.Provider.DotProduct(b, b); return 1.0 - num / Math.Sqrt(num2 * num3); } public static float Cosine(float[] a, float[] b) { if (a.Length != b.Length) { throw new ArgumentException("All vectors must have the same dimensionality."); } float num = LinearAlgebraControl.Provider.DotProduct(a, b); float num2 = LinearAlgebraControl.Provider.DotProduct(a, a); float num3 = LinearAlgebraControl.Provider.DotProduct(b, b); return (float)(1.0 - (double)num / Math.Sqrt(num2 * num3)); } public static double Hamming(double[] a, double[] b) { if (a.Length != b.Length) { throw new ArgumentException("All vectors must have the same dimensionality."); } int num = 0; for (int i = 0; i < a.Length; i++) { if (a[i] != b[i]) { num++; } } return num; } public static float Hamming(float[] a, float[] b) { if (a.Length != b.Length) { throw new ArgumentException("All vectors must have the same dimensionality."); } int num = 0; for (int i = 0; i < a.Length; i++) { if (a[i] != b[i]) { num++; } } return num; } public static double Pearson(IEnumerable<double> a, IEnumerable<double> b) { return 1.0 - Correlation.Pearson(a, b); } public static double Jaccard(double[] a, double[] b) { int num = 0; int num2 = 0; if (a == null) { throw new ArgumentNullException("a"); } if (b == null) { throw new ArgumentNullException("b"); } if (a.Length != b.Length) { throw new ArgumentException("All vectors must have the same dimensionality."); } if (a.Length == 0 && b.Length == 0) { return 0.0; } int i = 0; for (int num3 = a.Length; i < num3; i++) { if (a[i] != 0.0 && b[i] != 0.0) { if (a[i] == b[i]) { num++; } num2++; } } return 1.0 - (double)num / (double)num2; } public static double Jaccard(float[] a, float[] b) { int num = 0; int num2 = 0; if (a == null) { throw new ArgumentNullException("a"); } if (b == null) { throw new ArgumentNullException("b"); } if (a.Length != b.Length) { throw new ArgumentException("All vectors must have the same dimensionality."); } if (a.Length == 0 && b.Length == 0) { return 0.0; } int i = 0; for (int num3 = a.Length; i < num3; i++) { if (a[i] != 0f && b[i] != 0f) { if (a[i] == b[i]) { num++; } num2++; } } return 1.0 - (double)((float)num / (float)num2); } } public static class Euclid { private static readonly int[] MultiplyDeBruijnBitPosition = new int[32] { 0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30, 8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31 }; [MethodImpl(MethodImplOptions.AggressiveInlining)] public static double Modulus(double dividend, double divisor) { return (dividend % divisor + divisor) % divisor; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float Modulus(float dividend, float divisor) { return (dividend % divisor + divisor) % divisor; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int Modulus(int dividend, int divisor) { return (dividend % divisor + divisor) % divisor; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static long Modulus(long dividend, long divisor) { return (dividend % divisor + divisor) % divisor; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static BigInteger Modulus(BigInteger dividend, BigInteger divisor) { return (dividend % divisor + divisor) % divisor; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static double Remainder(double dividend, double divisor) { return dividend % divisor; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float Remainder(float dividend, float divisor) { return dividend % divisor; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int Remainder(int dividend, int divisor) { return dividend % divisor; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static long Remainder(long dividend, long divisor) { return dividend % divisor; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static BigInteger Remainder(BigInteger dividend, BigInteger divisor) { return dividend % divisor; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool IsEven(this int number) { return (number & 1) == 0; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool IsEven(this long number) { return (number & 1) == 0; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool IsOdd(this int number) { return (number & 1) == 1; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool IsOdd(this long number) { return (number & 1) == 1; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool IsPowerOfTwo(this int number) { if (number > 0) { return (number & (number - 1)) == 0; } return false; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool IsPowerOfTwo(this long number) { if (number > 0) { return (number & (number - 1)) == 0; } return false; } public static bool IsPerfectSquare(this int number) { if (number < 0) { return false; } int num = number & 0xF; if (num > 9) { return false; } if (num == 0 || num == 1 || num == 4 || num == 9) { int num2 = (int)Math.Floor(Math.Sqrt(number) + 0.5); return num2 * num2 == number; } return false; } public static bool IsPerfectSquare(this long number) { if (number < 0) { return false; } int num = (int)(number & 0xF); if (num > 9) { return false; } if (num == 0 || num == 1 || num == 4 || num == 9) { long num2 = (long)Math.Floor(Math.Sqrt(number) + 0.5); return num2 * num2 == number; } return false; } public static int PowerOfTwo(this int exponent) { if (exponent < 0 || exponent >= 31) { throw new ArgumentOutOfRangeException("exponent"); } return 1 << exponent; } public static long PowerOfTwo(this long exponent) { if (exponent < 0 || exponent >= 63) { throw new ArgumentOutOfRangeException("exponent"); } return 1L << (int)exponent; } public static int Log2(this int number) { number |= number >> 1; number |= number >> 2; number |= number >> 4; number |= number >> 8; number |= number >> 16; return MultiplyDeBruijnBitPosition[(uint)((long)number * 130329821L) >> 27]; } public static int CeilingToPowerOfTwo(this int number) { if (number == int.MinValue) { return 0; } if (number > 1073741824) { throw new ArgumentOutOfRangeException("number"); } number--; number |= number >> 1; number |= number >> 2; number |= number >> 4; number |= number >> 8; number |= number >> 16; return number + 1; } public static long CeilingToPowerOfTwo(this long number) { if (number == long.MinValue) { return 0L; } if (number > 4611686018427387904L) { throw new ArgumentOutOfRangeException("number"); } number--; number |= number >> 1; number |= number >> 2; number |= number >> 4; number |= number >> 8; number |= number >> 16; number |= number >> 32; return number + 1; } public static long GreatestCommonDivisor(long a, long b) { while (b != 0L) { long num = a % b; a = b; b = num; } return Math.Abs(a); } public static long GreatestCommonDivisor(IList<long> integers) { if (integers == null) { throw new ArgumentNullException("integers"); } if (integers.Count == 0) { return 0L; } long num = Math.Abs(integers[0]); for (int i = 1; i < integers.Count; i++) { if (num <= 1) { break; } num = GreatestCommonDivisor(num, integers[i]); } return num; } public static long GreatestCommonDivisor(params long[] integers) { return GreatestCommonDivisor((IList<long>)integers); } public static long ExtendedGreatestCommonDivisor(long a, long b, out long x, out long y) { long num = 1L; long num2 = 0L; long num3 = 0L; long num4 = 1L; while (b != 0L) { long result; long num5 = Math.DivRem(a, b, out result); a = b; b = result; long num6 = num3; num3 = num - num5 * num3; num = num6; long num7 = num4; num4 = num2 - num5 * num4; num2 = num7; } if (a >= 0) { x = num; y = num2; return a; } x = -num; y = -num2; return -a; } public static long LeastCommonMultiple(long a, long b) { if (a == 0L || b == 0L) { return 0L; } return Math.Abs(a / GreatestCommonDivisor(a, b) * b); } public static long LeastCommonMultiple(IList<long> integers) { if (integers == null) { throw new ArgumentNullException("integers"); } if (integers.Count == 0) { return 1L; } long num = Math.Abs(integers[0]); for (int i = 1; i < integers.Count; i++) { num = LeastCommonMultiple(num, integers[i]); } return num; } public static long LeastCommonMultiple(params long[] integers) { return LeastCommonMultiple((IList<long>)integers); } public static BigInteger GreatestCommonDivisor(BigInteger a, BigInteger b) { return BigInteger.GreatestCommonDivisor(a, b); } public static BigInteger GreatestCommonDivisor(IList<BigInteger> integers) { if (integers == null) { throw new ArgumentNullException("integers"); } if (integers.Count == 0) { return 0; } BigInteger bigInteger = BigInteger.Abs(integers[0]); for (int i = 1; i < integers.Count; i++) { if (!(bigInteger > BigInteger.One)) { break; } bigInteger = GreatestCommonDivisor(bigInteger, integers[i]); } return bigInteger; } public static BigInteger GreatestCommonDivisor(params BigInteger[] integers) { return GreatestCommonDivisor((IList<BigInteger>)integers); } public static BigInteger ExtendedGreatestCommonDivisor(BigInteger a, BigInteger b, out BigInteger x, out BigInteger y) { BigInteger bigInteger = BigInteger.One; BigInteger bigInteger2 = BigInteger.Zero; BigInteger bigInteger3 = BigInteger.Zero; BigInteger bigInteger4 = BigInteger.One; while (!b.IsZero) { BigInteger remainder; BigInteger bigInteger5 = BigInteger.DivRem(a, b, out remainder); a = b; b = remainder; BigInteger bigInteger6 = bigInteger3; bigInteger3 = bigInteger - bigInteger5 * bigInteger3; bigInteger = bigInteger6; BigInteger bigInteger7 = bigInteger4; bigInteger4 = bigInteger2 - bigInteger5 * bigInteger4; bigInteger2 = bigInteger7; } if (a >= BigInteger.Zero) { x = bigInteger; y = bigInteger2; return a; } x = -bigInteger; y = -bigInteger2; return -a; } public static BigInteger LeastCommonMultiple(BigInteger a, BigInteger b) { if (a.IsZero || b.IsZero) { return BigInteger.Zero; } return BigInteger.Abs(a / BigInteger.GreatestCommonDivisor(a, b) * b); } public static BigInteger LeastCommonMultiple(IList<BigInteger> integers) { if (integers == null) { throw new ArgumentNullException("integers"); } if (integers.Count == 0) { return 1; } BigInteger bigInteger = BigInteger.Abs(integers[0]); for (int i = 1; i < integers.Count; i++) { bigInteger = LeastCommonMultiple(bigInteger, integers[i]); } return bigInteger; } public static BigInteger LeastCommonMultiple(params BigInteger[] integers) { return LeastCommonMultiple((IList<BigInteger>)integers); } } public static class ExcelFunctions { [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static double NormSDist(double z) { return Normal.CDF(0.0, 1.0, z); } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static double NormSInv(double probability) { return Normal.InvCDF(0.0, 1.0, probability); } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static double NormDist(double x, double mean, double standardDev, bool cumulative) { if (!cumulative) { return Normal.PDF(mean, standardDev, x); } return Normal.CDF(mean, standardDev, x); } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static double NormInv(double probability, double mean, double standardDev) { return Normal.InvCDF(mean, standardDev, probability); } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static double TDist(double x, int degreesFreedom, int tails) { return tails switch { 1 => 1.0 - StudentT.CDF(0.0, 1.0, degreesFreedom, x), 2 => 1.0 - StudentT.CDF(0.0, 1.0, degreesFreedom, x) + StudentT.CDF(0.0, 1.0, degreesFreedom, 0.0 - x), _ => throw new ArgumentOutOfRangeException("tails"), }; } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static double TInv(double probability, int degreesFreedom) { return 0.0 - StudentT.InvCDF(0.0, 1.0, degreesFreedom, probability / 2.0); } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static double FDist(double x, int degreesFreedom1, int degreesFreedom2) { return 1.0 - FisherSnedecor.CDF(degreesFreedom1, degreesFreedom2, x); } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static double FInv(double probability, int degreesFreedom1, int degreesFreedom2) { return FisherSnedecor.InvCDF(degreesFreedom1, degreesFreedom2, 1.0 - probability); } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static double BetaDist(double x, double alpha, double beta) { return Beta.CDF(alpha, beta, x); } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static double BetaInv(double probability, double alpha, double beta) { return Beta.InvCDF(alpha, beta, probability); } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static double GammaDist(double x, double alpha, double beta, bool cumulative) { if (!cumulative) { return Gamma.PDF(alpha, 1.0 / beta, x); } return Gamma.CDF(alpha, 1.0 / beta, x); } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static double GammaInv(double probability, double alpha, double beta) { return Gamma.InvCDF(alpha, 1.0 / beta, probability); } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static double Quartile(double[] array, int quant) { return quant switch { 0 => ArrayStatistics.Minimum(array), 1 => array.QuantileCustom(0.25, QuantileDefinition.R7), 2 => array.QuantileCustom(0.5, QuantileDefinition.R7), 3 => array.QuantileCustom(0.75, QuantileDefinition.R7), 4 => ArrayStatistics.Maximum(array), _ => throw new ArgumentOutOfRangeException("quant"), }; } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static double Percentile(double[] array, double k) { return array.QuantileCustom(k, QuantileDefinition.R7); } [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] public static double PercentRank(double[] array, double x) { return array.QuantileRank(x, RankDefinition.Min); } } [Serializable] public class NonConvergenceException : Exception { public NonConvergenceException() : base("An algorithm failed to converge.") { } public NonConvergenceException(string message) : base(message) { } public NonConvergenceException(string message, Exception innerException) : base(message, innerException) { } protected NonConvergenceException(SerializationInfo info, StreamingContext context) : base(info, context) { } } [Serializable] public class NumericalBreakdownException : NonConvergenceException { public NumericalBreakdownException() : base("Algorithm experience a numerical break down.") { } public NumericalBreakdownException(string message) : base(message) { } public NumericalBreakdownException(string message, Exception innerException) : base(message, innerException) { } protected NumericalBreakdownException(SerializationInfo info, StreamingContext context) : base(info, context) { } } [Serializable] public abstract class NativeInterfaceException : Exception { protected NativeInterfaceException() { } protected NativeInterfaceException(string message) : base(message) { } protected NativeInterfaceException(string message, Exception innerException) : base(message, innerException) { } protected NativeInterfaceException(SerializationInfo info, StreamingContext context) : base(info, context) { } } [Serializable] public class InvalidParameterException : NativeInterfaceException { public InvalidParameterException() : base("An invalid parameter was passed to a native method.") { } public InvalidParameterException(int parameter) : base($"An invalid parameter was passed to a native method, parameter number : {parameter}") { } public InvalidParameterException(int parameter, Exception innerException) : base($"An invalid parameter was passed to a native method, parameter number : {parameter}", innerException) { } protected InvalidParameterException(SerializationInfo info, StreamingContext context) : base(info, context) { } } [Serializable] public class MemoryAllocationException : NativeInterfaceException { public MemoryAllocationException() : base("Unable to allocate native memory.") { } public MemoryAllocationException(Exception innerException) : base("Unable to allocate native memory.", innerException) { } protected MemoryAllocationException(SerializationInfo info, StreamingContext context) : base(info, context) { } } [Serializable] public class SingularUMatrixException : NativeInterfaceException { public SingularUMatrixException() : base("U is singular, and the inversion could not be completed.") { } public SingularUMatrixException(int element) : base($"U is singular, and the inversion could not be completed. The {element}-th diagonal element of the factor U is zero.") { } public SingularUMatrixException(int element, Exception innerException) : base($"U is singular, and the inversion could not be completed. The {element}-th diagonal element of the factor U is zero.", innerException) { } protected SingularUMatrixException(SerializationInfo info, StreamingContext context) : base(info, context) { } } public static class FindMinimum { public static double OfScalarFunctionConstrained(Func<double, double> function, double lowerBound, double upperBound, double tolerance = 1E-05, int maxIterations = 1000) { return GoldenSectionMinimizer.Minimum(ObjectiveFunction.ScalarValue(function), lowerBound, upperBound, tolerance, maxIterations).MinimizingPoint; } public static double OfScalarFunction(Func<double, double> function, double initialGuess, double tolerance = 1E-08, int maxIterations = 1000) { return NelderMeadSimplex.Minimum(ObjectiveFunction.Value((MathNet.Numerics.LinearAlgebra.Vector<double> v) => function(v[0])), CreateVector.Dense(new double[1] { initialGuess }), tolerance, maxIterations).MinimizingPoint[0]; } public static (double P0, double P1) OfFunction(Func<double, double, double> function, double initialGuess0, double initialGuess1, double tolerance = 1E-08, int maxIterations = 1000) { MinimizationResult minimizationResult = NelderMeadSimplex.Minimum(ObjectiveFunction.Value((MathNet.Numerics.LinearAlgebra.Vector<double> v) => function(v[0], v[1])), CreateVector.Dense(new double[2] { initialGuess0, initialGuess1 }), tolerance, maxIterations); return (minimizationResult.MinimizingPoint[0], minimizationResult.MinimizingPoint[1]); } public static (double P0, double P1, double P2) OfFunction(Func<double, double, double, double> function, double initialGuess0, double initialGuess1, double initialGuess2, double tolerance = 1E-08, int maxIterations = 1000) { MinimizationResult minimizationResult = NelderMeadSimplex.Minimum(ObjectiveFunction.Value((MathNet.Numerics.LinearAlgebra.Vector<double> v) => function(v[0], v[1], v[2])), CreateVector.Dense(new double[3] { initialGuess0, initialGuess1, initialGuess2 }), tolerance, maxIterations); return (minimizationResult.MinimizingPoint[0], minimizationResult.MinimizingPoint[1], minimizationResult.MinimizingPoint[2]); } public static (double P0, double P1, double P2, double P3) OfFunction(Func<double, double, double, double, double> function, double initialGuess0, double initialGuess1, double initialGuess2, double initialGuess3, double tolerance = 1E-08, int maxIterations = 1000) { MinimizationResult minimizationResult = NelderMeadSimplex.Minimum(ObjectiveFunction.Value((MathNet.Numerics.LinearAlgebra.Vector<double> v) => function(v[0], v[1], v[2], v[3])), CreateVector.Dense(new double[4] { initialGuess0, initialGuess1, initialGuess2, initialGuess3 }), tolerance, maxIterations); return (minimizationResult.MinimizingPoint[0], minimizationResult.MinimizingPoint[1], minimizationResult.MinimizingPoint[2], minimizationResult.MinimizingPoint[3]); } public static (double P0, double P1, double P2, double P3, double P4) OfFunction(Func<double, double, double, double, double, double> function, double initialGuess0, double initialGuess1, double initialGuess2, double initialGuess3, double initialGuess4, double tolerance = 1E-08, int maxIterations = 1000) { MinimizationResult minimizationResult = NelderMeadSimplex.Minimum(ObjectiveFunction.Value((MathNet.Numerics.LinearAlgebra.Vector<double> v) => function(v[0], v[1], v[2], v[3], v[4])), CreateVector.Dense(new double[5] { initialGuess0, initialGuess1, initialGuess2, initialGuess3, initialGuess4 }), tolerance, maxIterations); return (minimizationResult.MinimizingPoint[0], minimizationResult.MinimizingPoint[1], minimizationResult.MinimizingPoint[2], minimizationResult.MinimizingPoint[3], minimizationResult.MinimizingPoint[4]); } public static MathNet.Numerics.LinearAlgebra.Vector<double> OfFunction(Func<MathNet.Numerics.LinearAlgebra.Vector<double>, double> function, MathNet.Numerics.LinearAlgebra.Vector<double> initialGuess, double tolerance = 1E-08, int maxIterations = 1000) { return NelderMeadSimplex.Minimum(ObjectiveFunction.Value(function), initialGuess, tolerance, maxIterations).MinimizingPoint; } public static MathNet.Numerics.LinearAlgebra.Vector<double> OfFunctionConstrained(Func<MathNet.Numerics.LinearAlgebra.Vector<double>, double> function, MathNet.Numerics.LinearAlgebra.Vector<double> lowerBound, MathNet.Numerics.LinearAlgebra.Vector<double> upperBound, MathNet.Numerics.LinearAlgebra.Vector<double> initialGuess, double gradientTolerance = 1E-05, double parameterTolerance = 1E-05, double functionProgressTolerance = 1E-05, int maxIterations = 1000) { ForwardDifferenceGradientObjectiveFunction objective = new ForwardDifferenceGradientObjectiveFunction(ObjectiveFunction.Value(function), lowerBound, upperBound); return new BfgsBMinimizer(gradientTolerance, parameterTolerance, functionProgressTolerance, maxIterations).FindMinimum(objective, lowerBound, upperBound, initialGuess).MinimizingPoint; } public static MathNet.Numerics.LinearAlgebra.Vector<double> OfFunctionGradient(Func<MathNet.Numerics.LinearAlgebra.Vector<double>, double> function, Func<MathNet.Numerics.LinearAlgebra.Vector<double>, MathNet.Numerics.LinearAlgebra.Vector<double>> gradient, MathNet.Numerics.LinearAlgebra.Vector<double> initialGuess, double gradientTolerance = 1E-05, double parameterTolerance = 1E-05, double functionProgressTolerance = 1E-05, int maxIterations = 1000) { IObjectiveFunction objective = ObjectiveFunction.Gradient(function, gradient); return new BfgsMinimizer(gradientTolerance, parameterTolerance, functionProgressTolerance, maxIterations).FindMinimum(objective, initialGuess).MinimizingPoint; } public static MathNet.Numerics.LinearAlgebra.Vector<double> OfFunctionGradient(Func<MathNet.Numerics.LinearAlgebra.Vector<double>, (double, MathNet.Numerics.LinearAlgebra.Vector<double>)> functionGradient, MathNet.Numerics.LinearAlgebra.Vector<double> initialGuess, double gradientTolerance = 1E-05, double parameterTolerance = 1E-05, double functionProgressTolerance = 1E-05, int maxIterations = 1000) { IObjectiveFunction objective = ObjectiveFunction.Gradient(functionGradient); return new BfgsMinimizer(gradientTolerance, parameterTolerance, functionProgressTolerance, maxIterations).FindMinimum(objective, initialGuess).MinimizingPoint; } public static MathNet.Numerics.LinearAlgebra.Vector<double> OfFunctionGradientConstrained(Func<MathNet.Numerics.LinearAlgebra.Vector<double>, double> function, Func<MathNet.Numerics.LinearAlgebra.Vector<double>, MathNet.Numerics.LinearAlgebra.Vector<double>> gradient, MathNet.Numerics.LinearAlgebra.Vector<double> lowerBound, MathNet.Numerics.LinearAlgebra.Vector<double> upperBound, MathNet.Numerics.LinearAlgebra.Vector<double> initialGuess, double gradientTolerance = 1E-05, double parameterTolerance = 1E-05, double functionProgressTolerance = 1E-05, int maxIterations = 1000) { IObjectiveFunction objective = ObjectiveFunction.Gradient(function, gradient); return new BfgsBMinimizer(gradientTolerance, parameterTolerance, functionProgressTolerance, maxIterations).FindMinimum(objective, lowerBound, upperBound, initialGuess).MinimizingPoint; } public static MathNet.Numerics.LinearAlgebra.Vector<double> OfFunctionGradientConstrained(Func<MathNet.Numerics.LinearAlgebra.Vector<double>, (double, MathNet.Numerics.LinearAlgebra.Vector<double>)> functionGradient, MathNet.Numerics.LinearAlgebra.Vector<double> lowerBound, MathNet.Numerics.LinearAlgebra.Vector<double> upperBound, MathNet.Numerics.LinearAlgebra.Vector<double> initialGuess, double gradientTolerance = 1E-05, double parameterTolerance = 1E-05, double functionProgressTolerance = 1E-05, int maxIterations = 1000) { IObjectiveFunction objective = ObjectiveFunction.Gradient(functionGradient); return new BfgsBMinimizer(gradientTolerance, parameterTolerance, functionProgressTolerance, maxIterations).FindMinimum(objective, lowerBound, upperBound, initialGuess).MinimizingPoint; } public static MathNet.Numerics.LinearAlgebra.Vector<double> OfFunctionGradientHessian(Func<MathNet.Numerics.LinearAlgebra.Vector<double>, double> function, Func<MathNet.Numerics.LinearAlgebra.Vector<double>, MathNet.Numerics.LinearAlgebra.Vector<double>> gradient, Func<MathNet.Numerics.LinearAlgebra.Vector<double>, Matrix<double>> hessian, MathNet.Numerics.LinearAlgebra.Vector<double> initialGuess, double gradientTolerance = 1E-08, int maxIterations = 1000) { return NewtonMinimizer.Minimum(ObjectiveFunction.GradientHessian(function, gradient, hessian), initialGuess, gradientTolerance, maxIterations).MinimizingPoint; } public static MathNet.Numerics.LinearAlgebra.Vector<double> OfFunctionGradientHessian(Func<MathNet.Numerics.LinearAlgebra.Vector<double>, (double, MathNet.Numerics.LinearAlgebra.Vector<double>, Matrix<double>)> functionGradientHessian, MathNet.Numerics.LinearAlgebra.Vector<double> initialGuess, double gradientTolerance = 1E-08, int maxIterations = 1000) { return NewtonMinimizer.Minimum(ObjectiveFunction.GradientHessian(functionGradientHessian), initialGuess, gradientTolerance, maxIterations).MinimizingPoint; } } public static class FindRoots { public static double OfFunction(Func<double, double> f, double lowerBound, double upperBound, double accuracy = 1E-08, int maxIterations = 100) { if (!ZeroCrossingBracketing.ExpandReduce(f, ref lowerBound, ref upperBound, 1.6, maxIterations, maxIterations * 10)) { throw new NonConvergenceException("The algorithm has failed, exceeded the number of iterations allowed or there is no root within the provided bounds."); } if (Brent.TryFindRoot(f, lowerBound, upperBound, accuracy, maxIterations, out var root)) { return root; } if (Bisection.TryFindRoot(f, lowerBound, upperBound, accuracy, maxIterations, out root)) { return root; } throw new NonConvergenceException("The algorithm has failed, exceeded the number of iterations allowed or there is no root within the provided bounds."); } publi
BepInEx/core/Mirage.Core/MathNet.Numerics.FSharp.dll
Decompiled a month ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Numerics; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using <StartupCode$MathNet-Numerics-FSharp>; using <StartupCode$MathNet-Numerics-FSharp>.$MathNet.Numerics; using MathNet.Numerics; using MathNet.Numerics.Distributions; using MathNet.Numerics.LinearAlgebra; using MathNet.Numerics.LinearAlgebra.Factorization; using MathNet.Numerics.LinearAlgebra.Storage; using MathNet.Numerics.LinearRegression; using MathNet.Numerics.Random; using MathNet.Numerics.RootFinding; using Microsoft.FSharp.Collections; using Microsoft.FSharp.Core; using Microsoft.FSharp.Core.CompilerServices; [assembly: FSharpInterfaceDataVersion(2, 0, 0)] [assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = "")] [assembly: AssemblyCompany("Math.NET Project")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCopyright("Copyright Math.NET Project")] [assembly: AssemblyDescription("F# Modules for Math.NET Numerics, the numerical foundation of the Math.NET project, aiming to provide methods and algorithms for numerical computations in science, engineering and every day use. Supports .NET 5.0 or higher, .NET Standard 2.0 and .NET Framework 4.6.1 or higher, on Windows, Linux and Mac.")] [assembly: AssemblyFileVersion("5.0.0.0")] [assembly: AssemblyInformationalVersion("5.0.0")] [assembly: AssemblyProduct("Math.NET Numerics")] [assembly: AssemblyTitle("MathNet.Numerics.FSharp")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/mathnet/mathnet-numerics")] [assembly: NeutralResourcesLanguage("en")] [assembly: ComVisible(false)] [assembly: Guid("048BC4EB-CE2B-4040-9967-4784F5405B0F")] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyVersion("5.0.0.0")] namespace MathNet.Numerics { [Serializable] [Sealed] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal sealed class BigRationalLarge : IComparable<BigRationalLarge>, IComparable { internal BigInteger q; internal BigInteger p; internal bool IsNegative { get { BigInteger bigInteger = p; return bigInteger.Sign < 0; } } internal bool IsPositive { get { BigInteger bigInteger = p; return bigInteger.Sign > 0; } } internal BigInteger Numerator => p; internal BigInteger Denominator => q; internal int Sign { get { BigInteger bigInteger = p; return bigInteger.Sign; } } public BigRationalLarge(BigInteger p, BigInteger q) { this.p = p; this.q = q; } public override int GetHashCode() { if (q.IsOne) { return p.GetHashCode(); } return (p.GetHashCode() << 3) + q.GetHashCode(); } public override string ToString() { if (q.IsOne) { return p.ToString(); } return p.ToString() + "/" + q; } internal static bool Equals(BigRationalLarge x, BigRationalLarge y) { if (HashCompare.GenericEqualityIntrinsic<BigInteger>(x.p, y.p)) { return HashCompare.GenericEqualityIntrinsic<BigInteger>(x.q, y.q); } return false; } internal static int Compare(BigRationalLarge x, BigRationalLarge y) { return HashCompare.GenericComparisonIntrinsic<BigInteger>(x.p * y.q, y.p * x.q); } internal static double ToDouble(BigRationalLarge num) { return (double)num.p / (double)num.q; } internal static BigRationalLarge Normalize(BigInteger p, BigInteger q) { if (q.IsZero) { DivideByZeroException ex = new DivideByZeroException(); throw ex; } if (q.IsOne) { return new BigRationalLarge(p, q); } BigInteger bigInteger = BigInteger.GreatestCommonDivisor(p, q); BigInteger bigInteger2 = p / bigInteger; BigInteger bigInteger3 = q / bigInteger; if (bigInteger3.Sign < 0) { return new BigRationalLarge(-bigInteger2, -bigInteger3); } return new BigRationalLarge(bigInteger2, bigInteger3); } internal static BigRationalLarge Create(int p, int q) { return Normalize(new BigInteger(p), new BigInteger(q)); } internal static BigRationalLarge Create(BigInteger p, BigInteger q) { return Normalize(p, q); } internal static BigRationalLarge operator +(BigRationalLarge n1) { return n1; } internal static BigRationalLarge operator -(BigRationalLarge num) { return new BigRationalLarge(-num.p, num.q); } internal static BigRationalLarge operator +(BigRationalLarge x, BigRationalLarge y) { return Normalize(x.p * y.q + y.p * x.q, x.q * y.q); } internal static BigRationalLarge operator -(BigRationalLarge x, BigRationalLarge y) { return Normalize(x.p * y.q - y.p * x.q, x.q * y.q); } internal static BigRationalLarge operator *(BigRationalLarge x, BigRationalLarge y) { return Normalize(x.p * y.p, x.q * y.q); } internal static BigRationalLarge operator /(BigRationalLarge x, BigRationalLarge y) { return Normalize(x.p * y.q, x.q * y.p); } internal static BigRationalLarge Reciprocal(BigRationalLarge num) { return Normalize(num.q, num.p); } internal static BigRationalLarge Pow(BigRationalLarge num, int n) { if (n < 0) { return Normalize(BigInteger.Pow(num.q, -n), BigInteger.Pow(num.p, -n)); } return new BigRationalLarge(BigInteger.Pow(num.p, n), BigInteger.Pow(num.q, n)); } internal static BigRationalLarge FromBigInteger(BigInteger z) { BigInteger one = BigInteger.One; return Normalize(z, one); } internal static BigRationalLarge FromInt32(int n) { return Normalize(new BigInteger(n), new BigInteger(1)); } internal static BigInteger ToBigInteger(BigRationalLarge num) { BigInteger remainder = default(BigInteger); BigInteger bigInteger = BigInteger.DivRem(num.p, num.q, out remainder); if (HashCompare.GenericLessThanIntrinsic<BigInteger>(remainder, BigInteger.Zero)) { return bigInteger - BigInteger.One; } return bigInteger; } internal static BigRationalLarge Parse(string str) { int length = str.Length; if (length == 0) { throw new ArgumentException("empty string", "str"); } int num = str.IndexOf('/'); BigInteger bigInteger; BigInteger bigInteger2; if (num >= 0) { bigInteger = BigInteger.Parse(str.Substring(0, num)); bigInteger2 = BigInteger.Parse(str.Substring(num + 1, length - num - 1)); return Normalize(bigInteger, bigInteger2); } bigInteger = BigInteger.Parse(str); bigInteger2 = BigInteger.One; return Normalize(bigInteger, bigInteger2); } public override bool Equals(object that) { if (that is BigRationalLarge bigRationalLarge) { BigRationalLarge y = bigRationalLarge; return Equals(this, y); } return false; } virtual int IComparable.CompareTo(object obj) { if (obj is BigRationalLarge bigRationalLarge) { BigRationalLarge y = bigRationalLarge; return Compare(this, y); } throw new ArgumentException("the object does not have the correct type", "obj"); } virtual int IComparable<BigRationalLarge>.CompareTo(BigRationalLarge other) { return Compare(this, other); } } [Serializable] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [Sealed] [CustomEquality] [CustomComparison] [StructuredFormatDisplay("{StructuredDisplayString}N")] [DebuggerDisplay("{__DebugDisplay(),nq}")] [CompilationMapping(/*Could not decode attribute arguments.*/)] public abstract class BigRational : IComparable { internal static class Tags { public const int Z = 0; public const int Q = 1; } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(Z@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] internal class Z : BigRational { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly BigInteger item; [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] internal BigInteger Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [CompilerGenerated] [DebuggerNonUserCode] internal Z(BigInteger item) { this.item = item; } } [Serializable] [SpecialName] [DebuggerTypeProxy(typeof(Q@DebugTypeProxy))] [DebuggerDisplay("{__DebugDisplay(),nq}")] internal class Q : BigRational { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly BigRationalLarge item; [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] internal BigRationalLarge Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [CompilerGenerated] [DebuggerNonUserCode] internal Q(BigRationalLarge item) { this.item = item; } } [SpecialName] internal class Z@DebugTypeProxy { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal Z _obj; [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public BigInteger Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [CompilerGenerated] [DebuggerNonUserCode] public Z@DebugTypeProxy(Z obj) { _obj = obj; } } [SpecialName] internal class Q@DebugTypeProxy { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal Q _obj; [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] public BigRationalLarge Item { [CompilerGenerated] [DebuggerNonUserCode] get { return _obj.item; } } [CompilerGenerated] [DebuggerNonUserCode] public Q@DebugTypeProxy(Q obj) { _obj = obj; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal int Tag { [CompilerGenerated] [DebuggerNonUserCode] get { return (this is Q) ? 1 : 0; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool IsZ { [CompilerGenerated] [DebuggerNonUserCode] get { return this is Z; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool IsQ { [CompilerGenerated] [DebuggerNonUserCode] get { return this is Q; } } public BigInteger Numerator { get { if (!(this is Q)) { return ((Z)this).item; } Q q = (Q)this; return q.item.p; } } public BigInteger Denominator { get { if (!(this is Q)) { return BigInteger.One; } Q q = (Q)this; return q.item.q; } } public bool IsNegative { get { BigInteger item; if (!(this is Q)) { Z z = (Z)this; item = z.item; return item.Sign < 0; } Q q = (Q)this; BigRationalLarge item2 = q.item; item = item2.p; return item.Sign < 0; } } public bool IsPositive { get { BigInteger item; if (!(this is Q)) { Z z = (Z)this; item = z.item; return item.Sign > 0; } Q q = (Q)this; BigRationalLarge item2 = q.item; item = item2.p; return item.Sign > 0; } } public bool IsInteger { get { if (!(this is Q)) { return true; } Q q = (Q)this; BigRationalLarge item = q.item; BigInteger q2 = item.q; return q2.IsOne; } } public bool IsZero { get { BigInteger item; if (!(this is Q)) { Z z = (Z)this; item = z.item; return item.IsZero; } Q q = (Q)this; BigRationalLarge item2 = q.item; item = item2.p; return item.IsZero; } } public bool IsOne { get { BigInteger item; if (!(this is Q)) { Z z = (Z)this; item = z.item; return item.IsOne; } Q q = (Q)this; BigRationalLarge item2 = q.item; item = item2.q; if (item.IsOne) { item = item2.p; return item.IsOne; } return false; } } public int Sign { get { if (IsNegative) { return -1; } if (IsPositive) { return 1; } return 0; } } public string StructuredDisplayString => ToString(); public static BigRational Zero => NewZ(new BigInteger(0)); public static BigRational One => NewZ(new BigInteger(1)); [CompilerGenerated] [DebuggerNonUserCode] internal BigRational() { } [CompilationMapping(/*Could not decode attribute arguments.*/)] internal static BigRational NewZ(BigInteger item) { return new Z(item); } [CompilationMapping(/*Could not decode attribute arguments.*/)] internal static BigRational NewQ(BigRationalLarge item) { return new Q(item); } [SpecialName] [CompilerGenerated] [DebuggerNonUserCode] internal object __DebugDisplay() { return ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<BigRational, string>>((PrintfFormat<FSharpFunc<BigRational, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<BigRational, string>, Unit, string, string, string>("%+0.8A")).Invoke(this); } public override bool Equals(object obj) { if (obj is BigRational bigRational) { BigRational bigRational2 = bigRational; return this == bigRational2; } return false; } public override int GetHashCode() { if (!(this is Q)) { Z z = (Z)this; return z.item.GetHashCode(); } Q q = (Q)this; return q.item.GetHashCode(); } public override string ToString() { if (!(this is Q)) { Z z = (Z)this; return z.item.ToString(); } Q q = (Q)this; return q.item.ToString(); } public static BigRational Parse(string str) { return NewQ(BigRationalLarge.Parse(str)); } public static BigRational FromInt(int x) { return NewZ(new BigInteger(x)); } public static BigRational FromBigInt(BigInteger x) { return NewZ(x); } public static BigRational FromIntFraction(int numerator, int denominator) { return NewQ(BigRationalLarge.Normalize(new BigInteger(numerator), new BigInteger(denominator))); } public static BigRational FromBigIntFraction(BigInteger numerator, BigInteger denominator) { return NewQ(BigRationalLarge.Normalize(numerator, denominator)); } public static BigRational FromDecimal(decimal n) { int[] bits = decimal.GetBits(n); int value = bits[0]; BigInteger bigInteger = new BigInteger((uint)value) << 0; value = bits[1]; BigInteger bigInteger2 = new BigInteger((uint)value) << 32; value = bits[2]; BigInteger bigInteger3 = new BigInteger((uint)value) << 64; BigInteger bigInteger4 = ((((uint)bits[3] & 0x80000000u) != 0) ? new BigInteger(-1) : BigInteger.One); value = (bits[3] >> 16) & 0x7F; BigInteger p = bigInteger4 * (bigInteger + bigInteger2 + bigInteger3); BigInteger q = BigInteger.Pow(new BigInteger(10), value); return NewQ(BigRationalLarge.Normalize(p, q)); } public static BigRational operator +(BigRational n1, BigRational n2) { Z z; BigInteger item; BigInteger one; if (n1 is Q) { Q q = (Q)n1; BigRationalLarge item2; BigRationalLarge bigRationalLarge; if (n2 is Z) { z = (Z)n2; item = z.item; item2 = q.item; one = BigInteger.One; bigRationalLarge = BigRationalLarge.Normalize(item, one); return NewQ(item2 + bigRationalLarge); } Q q2 = (Q)n2; item2 = q2.item; bigRationalLarge = q.item; return NewQ(bigRationalLarge + item2); } z = (Z)n1; if (n2 is Q) { Q q = (Q)n2; item = z.item; BigRationalLarge item2 = q.item; one = BigInteger.One; BigRationalLarge bigRationalLarge = BigRationalLarge.Normalize(item, one); return NewQ(bigRationalLarge + item2); } Z z2 = (Z)n2; item = z2.item; one = z.item; return NewZ(one + item); } public static BigRational operator -(BigRational n1, BigRational n2) { Z z; BigInteger item; BigInteger one; if (n1 is Q) { Q q = (Q)n1; BigRationalLarge item2; BigRationalLarge bigRationalLarge; if (n2 is Z) { z = (Z)n2; item = z.item; item2 = q.item; one = BigInteger.One; bigRationalLarge = BigRationalLarge.Normalize(item, one); return NewQ(item2 - bigRationalLarge); } Q q2 = (Q)n2; item2 = q2.item; bigRationalLarge = q.item; return NewQ(bigRationalLarge - item2); } z = (Z)n1; if (n2 is Q) { Q q = (Q)n2; item = z.item; BigRationalLarge item2 = q.item; one = BigInteger.One; BigRationalLarge bigRationalLarge = BigRationalLarge.Normalize(item, one); return NewQ(bigRationalLarge - item2); } Z z2 = (Z)n2; item = z2.item; one = z.item; return NewZ(one - item); } public static BigRational operator *(BigRational n1, BigRational n2) { Z z; BigInteger item; BigInteger one; if (n1 is Q) { Q q = (Q)n1; BigRationalLarge item2; BigRationalLarge bigRationalLarge; if (n2 is Z) { z = (Z)n2; item = z.item; item2 = q.item; one = BigInteger.One; bigRationalLarge = BigRationalLarge.Normalize(item, one); return NewQ(item2 * bigRationalLarge); } Q q2 = (Q)n2; item2 = q2.item; bigRationalLarge = q.item; return NewQ(bigRationalLarge * item2); } z = (Z)n1; if (n2 is Q) { Q q = (Q)n2; item = z.item; BigRationalLarge item2 = q.item; one = BigInteger.One; BigRationalLarge bigRationalLarge = BigRationalLarge.Normalize(item, one); return NewQ(bigRationalLarge * item2); } Z z2 = (Z)n2; item = z2.item; one = z.item; return NewZ(one * item); } public static BigRational operator /(BigRational n1, BigRational n2) { Z z; BigInteger item; BigInteger one; if (n1 is Q) { Q q = (Q)n1; BigRationalLarge item2; BigRationalLarge bigRationalLarge; if (n2 is Z) { z = (Z)n2; item = z.item; item2 = q.item; one = BigInteger.One; bigRationalLarge = BigRationalLarge.Normalize(item, one); return NewQ(item2 / bigRationalLarge); } Q q2 = (Q)n2; item2 = q2.item; bigRationalLarge = q.item; return NewQ(bigRationalLarge / item2); } z = (Z)n1; if (n2 is Q) { Q q = (Q)n2; item = z.item; BigRationalLarge item2 = q.item; one = BigInteger.One; BigRationalLarge bigRationalLarge = BigRationalLarge.Normalize(item, one); return NewQ(bigRationalLarge / item2); } Z z2 = (Z)n2; item = z2.item; one = z.item; return NewQ(BigRationalLarge.Normalize(one, item)); } public static BigRational operator -(BigRational n) { if (!(n is Q)) { Z z = (Z)n; BigInteger item = z.item; return NewZ(-item); } Q q = (Q)n; BigRationalLarge item2 = q.item; return NewQ(new BigRationalLarge(-item2.p, item2.q)); } public static BigRational operator +(BigRational n) { return n; } public static bool operator ==(BigRational n, BigRational nn) { Z z; BigInteger item; BigInteger one; if (n is Q) { Q q = (Q)n; BigRationalLarge item2; if (nn is Z) { z = (Z)nn; item = z.item; item2 = q.item; BigRationalLarge x = item2; one = BigInteger.One; return BigRationalLarge.Equals(x, BigRationalLarge.Normalize(item, one)); } Q q2 = (Q)nn; item2 = q2.item; BigRationalLarge item3 = q.item; return BigRationalLarge.Equals(item3, item2); } z = (Z)n; if (nn is Q) { Q q = (Q)nn; item = z.item; BigRationalLarge item2 = q.item; one = BigInteger.One; return BigRationalLarge.Equals(BigRationalLarge.Normalize(item, one), item2); } Z z2 = (Z)nn; item = z2.item; one = z.item; return one == item; } public static bool operator !=(BigRational n, BigRational nn) { return !(n == nn); } public static bool operator <(BigRational n, BigRational nn) { Z z; BigInteger item; BigInteger one; if (n is Q) { Q q = (Q)n; BigRationalLarge item2; if (nn is Z) { z = (Z)nn; item = z.item; item2 = q.item; BigRationalLarge bigRationalLarge = item2; one = BigInteger.One; return HashCompare.GenericLessThanIntrinsic<BigRationalLarge>(bigRationalLarge, BigRationalLarge.Normalize(item, one)); } Q q2 = (Q)nn; item2 = q2.item; BigRationalLarge item3 = q.item; return HashCompare.GenericLessThanIntrinsic<BigRationalLarge>(item3, item2); } z = (Z)n; if (nn is Q) { Q q = (Q)nn; item = z.item; BigRationalLarge item2 = q.item; one = BigInteger.One; return HashCompare.GenericLessThanIntrinsic<BigRationalLarge>(BigRationalLarge.Normalize(item, one), item2); } Z z2 = (Z)nn; item = z2.item; one = z.item; return HashCompare.GenericLessThanIntrinsic<BigInteger>(one, item); } public static bool operator <=(BigRational n, BigRational nn) { Z z; BigInteger item; BigInteger one; if (n is Q) { Q q = (Q)n; BigRationalLarge item2; if (nn is Z) { z = (Z)nn; item = z.item; item2 = q.item; BigRationalLarge bigRationalLarge = item2; one = BigInteger.One; return HashCompare.GenericLessOrEqualIntrinsic<BigRationalLarge>(bigRationalLarge, BigRationalLarge.Normalize(item, one)); } Q q2 = (Q)nn; item2 = q2.item; BigRationalLarge item3 = q.item; return HashCompare.GenericLessOrEqualIntrinsic<BigRationalLarge>(item3, item2); } z = (Z)n; if (nn is Q) { Q q = (Q)nn; item = z.item; BigRationalLarge item2 = q.item; one = BigInteger.One; return HashCompare.GenericLessOrEqualIntrinsic<BigRationalLarge>(BigRationalLarge.Normalize(item, one), item2); } Z z2 = (Z)nn; item = z2.item; one = z.item; return HashCompare.GenericLessOrEqualIntrinsic<BigInteger>(one, item); } public static bool operator >(BigRational n, BigRational nn) { Z z; BigInteger item; BigInteger one; if (n is Q) { Q q = (Q)n; BigRationalLarge item2; if (nn is Z) { z = (Z)nn; item = z.item; item2 = q.item; BigRationalLarge bigRationalLarge = item2; one = BigInteger.One; return HashCompare.GenericGreaterThanIntrinsic<BigRationalLarge>(bigRationalLarge, BigRationalLarge.Normalize(item, one)); } Q q2 = (Q)nn; item2 = q2.item; BigRationalLarge item3 = q.item; return HashCompare.GenericGreaterThanIntrinsic<BigRationalLarge>(item3, item2); } z = (Z)n; if (nn is Q) { Q q = (Q)nn; item = z.item; BigRationalLarge item2 = q.item; one = BigInteger.One; return HashCompare.GenericGreaterThanIntrinsic<BigRationalLarge>(BigRationalLarge.Normalize(item, one), item2); } Z z2 = (Z)nn; item = z2.item; one = z.item; return HashCompare.GenericGreaterThanIntrinsic<BigInteger>(one, item); } public static bool operator >=(BigRational n, BigRational nn) { Z z; BigInteger item; BigInteger one; if (n is Q) { Q q = (Q)n; BigRationalLarge item2; if (nn is Z) { z = (Z)nn; item = z.item; item2 = q.item; BigRationalLarge bigRationalLarge = item2; one = BigInteger.One; return HashCompare.GenericGreaterOrEqualIntrinsic<BigRationalLarge>(bigRationalLarge, BigRationalLarge.Normalize(item, one)); } Q q2 = (Q)nn; item2 = q2.item; BigRationalLarge item3 = q.item; return HashCompare.GenericGreaterOrEqualIntrinsic<BigRationalLarge>(item3, item2); } z = (Z)n; if (nn is Q) { Q q = (Q)nn; item = z.item; BigRationalLarge item2 = q.item; one = BigInteger.One; return HashCompare.GenericGreaterOrEqualIntrinsic<BigRationalLarge>(BigRationalLarge.Normalize(item, one), item2); } Z z2 = (Z)nn; item = z2.item; one = z.item; return HashCompare.GenericGreaterOrEqualIntrinsic<BigInteger>(one, item); } public static BigRational Abs(BigRational n) { if (n.IsNegative) { return -n; } return n; } public static BigRational Reciprocal(BigRational n) { if (!(n is Q)) { Z z = (Z)n; BigInteger item = z.item; BigInteger one = BigInteger.One; return NewQ(BigRationalLarge.Normalize(one, item)); } Q q = (Q)n; BigRationalLarge item2 = q.item; return NewQ(BigRationalLarge.Normalize(item2.q, item2.p)); } public static BigRational Pow(BigRational n, int i) { if (n is Z) { Z z = (Z)n; if (i > 0) { BigInteger item = z.item; return NewZ(BigInteger.Pow(item, i)); } } if (!(n is Q)) { Z z2 = (Z)n; BigInteger item = z2.item; BigInteger one = BigInteger.One; return NewQ(BigRationalLarge.Pow(BigRationalLarge.Normalize(item, one), i)); } Q q = (Q)n; BigRationalLarge item2 = q.item; return NewQ(BigRationalLarge.Pow(item2, i)); } public static BigRational PowN(BigRational n, int i) { return Pow(n, i); } public static double ToDouble(BigRational n) { if (!(n is Q)) { Z z = (Z)n; return (double)z.item; } Q q = (Q)n; BigRationalLarge item = q.item; return (double)item.p / (double)item.q; } public static BigInteger ToBigInt(BigRational n) { if (!(n is Q)) { return ((Z)n).item; } Q q = (Q)n; return BigRationalLarge.ToBigInteger(q.item); } public static int ToInt32(BigRational n) { if (!(n is Q)) { Z z = (Z)n; return (int)z.item; } Q q = (Q)n; BigRationalLarge item = q.item; return (int)BigRationalLarge.ToBigInteger(item); } public static explicit operator int(BigRational n) { return ToInt32(n); } public static explicit operator BigInteger(BigRational n) { return ToBigInt(n); } public static explicit operator double(BigRational n) { return ToDouble(n); } virtual int IComparable.CompareTo(object obj) { if (obj is BigRational bigRational) { BigRational bigRational2 = bigRational; if (this < bigRational2) { return -1; } if (this == bigRational2) { return 0; } return 1; } throw new ArgumentException("The objects are not comparable.", "obj"); } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public sealed class Quaternion : IEquatable<Quaternion>, IStructuralEquatable, IComparable<Quaternion>, IComparable, IStructuralComparable { [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal double w@; [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal double x@; [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal double y@; [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal double z@; [CompilationMapping(/*Could not decode attribute arguments.*/)] public double w => w@; [CompilationMapping(/*Could not decode attribute arguments.*/)] public double x => x@; [CompilationMapping(/*Could not decode attribute arguments.*/)] public double y => y@; [CompilationMapping(/*Could not decode attribute arguments.*/)] public double z => z@; public Quaternion(double w, double x, double y, double z) { w@ = w; x@ = x; y@ = y; z@ = z; } [CompilerGenerated] public override string ToString() { return ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<Quaternion, string>>((PrintfFormat<FSharpFunc<Quaternion, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<Quaternion, string>, Unit, string, string, Quaternion>("%+A")).Invoke(this); } [CompilerGenerated] public sealed int CompareTo(Quaternion obj) { if (this != null) { if (obj != null) { IComparer genericComparer = LanguagePrimitives.GenericComparer; double num = w@; double num2 = obj.w@; int num3 = ((num < num2) ? (-1) : ((num > num2) ? 1 : ((num != num2) ? HashCompare.GenericComparisonWithComparerIntrinsic<double>(genericComparer, num, num2) : 0))); if (num3 < 0) { return num3; } if (num3 > 0) { return num3; } return $Quaternion.CompareTo$cont@32(this, obj, null); } return 1; } if (obj != null) { return -1; } return 0; } [CompilerGenerated] public sealed int CompareTo(object obj) { return CompareTo((Quaternion)obj); } [CompilerGenerated] public sealed int CompareTo(object obj, IComparer comp) { Quaternion quaternion = (Quaternion)obj; if (this != null) { if ((Quaternion)obj != null) { double num = w@; double num2 = quaternion.w@; int num3 = ((num < num2) ? (-1) : ((num > num2) ? 1 : ((num != num2) ? HashCompare.GenericComparisonWithComparerIntrinsic<double>(comp, num, num2) : 0))); if (num3 < 0) { return num3; } if (num3 > 0) { return num3; } return $Quaternion.CompareTo$cont@32-1(comp, this, quaternion, null); } return 1; } if ((Quaternion)obj != null) { return -1; } return 0; } [CompilerGenerated] public sealed int GetHashCode(IEqualityComparer comp) { if (this != null) { int num = 0; num = -1640531527 + (HashCompare.GenericHashWithComparerIntrinsic<double>(comp, z@) + ((num << 6) + (num >> 2))); num = -1640531527 + (HashCompare.GenericHashWithComparerIntrinsic<double>(comp, y@) + ((num << 6) + (num >> 2))); num = -1640531527 + (HashCompare.GenericHashWithComparerIntrinsic<double>(comp, x@) + ((num << 6) + (num >> 2))); return -1640531527 + (HashCompare.GenericHashWithComparerIntrinsic<double>(comp, w@) + ((num << 6) + (num >> 2))); } return 0; } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public sealed bool Equals(object obj, IEqualityComparer comp) { if (this != null) { if (obj is Quaternion quaternion) { if (w@ == quaternion.w@) { if (x@ == quaternion.x@) { if (y@ == quaternion.y@) { return z@ == quaternion.z@; } return false; } return false; } return false; } return false; } return obj == null; } public static Quaternion operator +(Quaternion r, Quaternion q) { return new Quaternion(r.w@ + q.w@, r.x@ + q.x@, r.y@ + q.y@, r.z@ + q.z@); } public static Quaternion operator -(Quaternion r, Quaternion q) { return new Quaternion(r.w@ - q.w@, r.x@ - q.x@, r.y@ - q.y@, r.z@ - q.z@); } public static Quaternion operator *(Quaternion r, Quaternion q) { return new Quaternion(r.w@ * q.w@ - r.x@ * q.x@ - r.y@ * q.y@ - r.z@ * q.z@, r.w@ * q.x@ + r.x@ * q.w@ - r.y@ * q.z@ + r.z@ * q.y@, r.w@ * q.y@ + r.x@ * q.z@ + r.y@ * q.w@ - r.z@ * q.x@, r.w@ * q.z@ - r.x@ * q.y@ + r.y@ * q.x@ + r.z@ * q.w@); } public static Quaternion operator /(Quaternion r, Quaternion q) { double num = Math.Pow(r.w@, 2.0) + Math.Pow(r.x@, 2.0) + Math.Pow(r.y@, 2.0) + Math.Pow(r.z@, 2.0); return new Quaternion((r.w@ * q.w@ + r.x@ * q.x@ + r.y@ * q.y@ + r.z@ * q.z@) / num, (r.w@ * q.x@ - r.x@ * q.w@ - r.y@ * q.z@ + r.z@ * q.y@) / num, (r.w@ * q.y@ + r.x@ * q.z@ - r.y@ * q.w@ - r.z@ * q.x@) / num, (r.w@ * q.z@ - r.x@ * q.y@ + r.y@ * q.x@ - r.z@ * q.w@) / num); } public static Quaternion operator /(Quaternion q, double a) { return new Quaternion(q.w@ / a, q.x@ / a, q.y@ / a, q.z@ / a); } [CompilerGenerated] public sealed bool Equals(Quaternion obj) { if (this != null) { if (obj != null) { return $Quaternion.Equals$cont@32(this, obj, null); } return false; } return obj == null; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is Quaternion obj2) { return Equals(obj2); } return false; } } [CompilationRepresentation(/*Could not decode attribute arguments.*/)] [CompilationMapping(/*Could not decode attribute arguments.*/)] public static class QuaternionModule { public static double normSquared(Quaternion q) { return q.w@ * q.w@ + q.x@ * q.x@ + q.y@ * q.y@ + q.z@ * q.z@; } public static double norm(Quaternion q) { return Math.Sqrt(normSquared(q)); } public static Quaternion normalize(Quaternion q) { double num = 1.0 / Math.Sqrt(normSquared(q)); return new Quaternion(q.w@ * num, q.x@ * num, q.y@ * num, q.z@ * num); } public static Quaternion conjugate(Quaternion q) { return new Quaternion(q.w@, 0.0 - q.x@, 0.0 - q.y@, 0.0 - q.z@); } public static Quaternion inverse(Quaternion q) { Quaternion quaternion = conjugate(q); double num = normSquared(q); return quaternion / num; } [CompilationArgumentCounts(new int[] { 1, 1 })] public static double dot(Quaternion q1, Quaternion q2) { return q1.w@ * q2.w@ + q1.x@ * q2.x@ + q1.y@ * q2.y@ + q1.z@ * q2.z@; } [Obsolete("Semantic Version Opt-Out: this routine has not been finalized yet and may change in breaking ways within minor versions.")] [CompilationArgumentCounts(new int[] { 1, 1, 1, 1 })] public static Quaternion create(double angle, double x, double y, double z) { double d = x * x + y * y + z * z; double num = 1.0 / Math.Sqrt(d); double num2 = x * num; double num3 = y * num; double num4 = z * num; double num5 = angle * 0.5; double num6 = Math.Sin(num5); return new Quaternion(Math.Cos(num5), num2 * num6, num3 * num6, num4 * num6); } [Obsolete("Semantic Version Opt-Out: this routine has not been finalized yet and may change in breaking ways within minor versions.")] [CompilationArgumentCounts(new int[] { 1, 1, 1, 1 })] public static Quaternion rotate(Quaternion q1, double x, double y, double z) { Quaternion quaternion = normalize(q1); Quaternion quaternion2 = new Quaternion(0.0, x, y, z); Quaternion quaternion3 = quaternion * quaternion2; Quaternion quaternion4 = inverse(quaternion); return quaternion3 * quaternion4; } [Obsolete("Semantic Version Opt-Out: this routine has not been finalized yet and may change in breaking ways within minor versions.")] [CompilationArgumentCounts(new int[] { 1, 1 })] public static Quaternion concat(Quaternion q, Quaternion q') { return q' * q; } } } namespace <StartupCode$MathNet-Numerics-FSharp> { internal static class $Quaternion { } } namespace MathNet.Numerics { [CompilationMapping(/*Could not decode attribute arguments.*/)] public static class Probability { [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public sealed class Outcome<T> : IEquatable<Outcome<T>>, IStructuralEquatable, IComparable<Outcome<T>>, IComparable, IStructuralComparable { [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal T Value@; [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal BigRational Probability@; [CompilationMapping(/*Could not decode attribute arguments.*/)] public T Value => Value@; [CompilationMapping(/*Could not decode attribute arguments.*/)] public BigRational Probability => Probability@; public Outcome(T value, BigRational probability) { Value@ = value; Probability@ = probability; } [CompilerGenerated] public override string ToString() { return ((FSharpFunc<Outcome<Outcome<T>>, string>)(object)ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<Outcome<T>, string>>((PrintfFormat<FSharpFunc<Outcome<T>, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<Outcome<FSharpFunc<Outcome<T>, string>>, string>, Unit, string, string, Outcome<FSharpFunc<Outcome<T>, string>>>("%+A"))).Invoke((Outcome<Outcome<T>>)(object)this); } [CompilerGenerated] public sealed int CompareTo(Outcome<T> obj) { if (this != null) { if (obj != null) { IComparer genericComparer = LanguagePrimitives.GenericComparer; T value@ = Value@; T value@2 = obj.Value@; int num = HashCompare.GenericComparisonWithComparerIntrinsic<T>(genericComparer, value@, value@2); if (num < 0) { return num; } if (num > 0) { return num; } return HashCompare.GenericComparisonWithComparerIntrinsic<BigRational>(LanguagePrimitives.GenericComparer, Probability@, obj.Probability@); } return 1; } if (obj != null) { return -1; } return 0; } [CompilerGenerated] public sealed int CompareTo(object obj) { return CompareTo((Outcome<T>)obj); } [CompilerGenerated] public sealed int CompareTo(object obj, IComparer comp) { Outcome<T> outcome = (Outcome<T>)obj; if (this != null) { if ((Outcome<T>)obj != null) { T value@ = Value@; T value@2 = outcome.Value@; int num = HashCompare.GenericComparisonWithComparerIntrinsic<T>(comp, value@, value@2); if (num < 0) { return num; } if (num > 0) { return num; } return HashCompare.GenericComparisonWithComparerIntrinsic<BigRational>(comp, Probability@, outcome.Probability@); } return 1; } if ((Outcome<T>)obj != null) { return -1; } return 0; } [CompilerGenerated] public sealed int GetHashCode(IEqualityComparer comp) { if (this != null) { int num = 0; num = -1640531527 + (HashCompare.GenericHashWithComparerIntrinsic<BigRational>(comp, Probability@) + ((num << 6) + (num >> 2))); T value@ = Value@; return -1640531527 + (HashCompare.GenericHashWithComparerIntrinsic<T>(comp, value@) + ((num << 6) + (num >> 2))); } return 0; } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public sealed bool Equals(object obj, IEqualityComparer comp) { if (this != null) { if (obj is Outcome<T> outcome) { T value@ = Value@; T value@2 = outcome.Value@; if (HashCompare.GenericEqualityWithComparerIntrinsic<T>(comp, value@, value@2)) { return HashCompare.GenericEqualityWithComparerIntrinsic<BigRational>(comp, Probability@, outcome.Probability@); } return false; } return false; } return obj == null; } [CompilerGenerated] public sealed bool Equals(Outcome<T> obj) { if (this != null) { if (obj != null) { T value@ = Value@; T value@2 = obj.Value@; if (HashCompare.GenericEqualityERIntrinsic<T>(value@, value@2)) { return HashCompare.GenericEqualityERIntrinsic<BigRational>(Probability@, obj.Probability@); } return false; } return false; } return obj == null; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is Outcome<T> obj2) { return Equals(obj2); } return false; } } [Serializable] internal sealed class bind@21-1<a, c> : FSharpFunc<Outcome<c>, Outcome<c>> { public Outcome<a> p1; [CompilerGenerated] [DebuggerNonUserCode] internal bind@21-1(Outcome<a> p1) { ((FSharpFunc<Outcome<Outcome<c>>, Outcome<Outcome<c>>>)(object)this)..ctor(); this.p1 = p1; } public override Outcome<c> Invoke(Outcome<c> p2) { c value@ = p2.Value@; BigRational probability@ = p1.Probability@; BigRational probability@2 = p2.Probability@; return new Outcome<c>(value@, probability@ * probability@2); } } [Serializable] internal sealed class bind@19<a, b, c> : FSharpFunc<Outcome<a>, IEnumerable<Outcome<c>>> where b : IEnumerable<Outcome<c>> { public FSharpFunc<a, b> f; [CompilerGenerated] [DebuggerNonUserCode] internal bind@19(FSharpFunc<a, b> f) { ((FSharpFunc<Outcome<Outcome<a>>, IEnumerable<Outcome<?>>>)(object)this)..ctor(); this.f = f; } public override IEnumerable<Outcome<c>> Invoke(Outcome<a> p1) { b val = f.Invoke(p1.Value@); return SeqModule.Map<Outcome<c>, Outcome<c>>((FSharpFunc<Outcome<c>, Outcome<c>>)new bind@21-1<a, c>(p1), (IEnumerable<Outcome<c>>)(object)val); } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public class RandomVariableBuilder { public IEnumerable<Outcome<e>> Bind<c, d, e>(IEnumerable<Outcome<c>> r, FSharpFunc<c, d> f) where d : IEnumerable<Outcome<e>> { return bind<c, d, e>(f, r); } public IEnumerable<Outcome<b>> Return<b>(b x) { return returnM(x); } public a ReturnFrom<a>(a x) { return x; } } [Serializable] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [DebuggerDisplay("{__DebugDisplay(),nq}")] [CompilationMapping(/*Could not decode attribute arguments.*/)] public sealed class CoinSide : IEquatable<CoinSide>, IStructuralEquatable, IComparable<CoinSide>, IComparable, IStructuralComparable { public static class Tags { public const int Heads = 0; public const int Tails = 1; } [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal static readonly CoinSide _unique_Heads = new CoinSide(0); [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal static readonly CoinSide _unique_Tails = new CoinSide(1); [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] [field: DebuggerNonUserCode] public int Tag { [DebuggerNonUserCode] get; } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public static CoinSide Heads { [CompilationMapping(/*Could not decode attribute arguments.*/)] get { return _unique_Heads; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsHeads { [CompilerGenerated] [DebuggerNonUserCode] get { return Tag == 0; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public static CoinSide Tails { [CompilationMapping(/*Could not decode attribute arguments.*/)] get { return _unique_Tails; } } [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public bool IsTails { [CompilerGenerated] [DebuggerNonUserCode] get { return Tag == 1; } } [CompilerGenerated] [DebuggerNonUserCode] internal CoinSide(int _tag) { this._tag = _tag; } [SpecialName] [CompilerGenerated] [DebuggerNonUserCode] internal object __DebugDisplay() { return ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<CoinSide, string>>((PrintfFormat<FSharpFunc<CoinSide, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<CoinSide, string>, Unit, string, string, string>("%+0.8A")).Invoke(this); } [CompilerGenerated] public override string ToString() { return ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<CoinSide, string>>((PrintfFormat<FSharpFunc<CoinSide, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<CoinSide, string>, Unit, string, string, CoinSide>("%+A")).Invoke(this); } [CompilerGenerated] public sealed int CompareTo(CoinSide obj) { if (this != null) { if (obj != null) { int tag = _tag; int tag2 = obj._tag; if (tag == tag2) { return 0; } return tag - tag2; } return 1; } if (obj != null) { return -1; } return 0; } [CompilerGenerated] public sealed int CompareTo(object obj) { return CompareTo((CoinSide)obj); } [CompilerGenerated] public sealed int CompareTo(object obj, IComparer comp) { CoinSide coinSide = (CoinSide)obj; if (this != null) { if ((CoinSide)obj != null) { int tag = _tag; int tag2 = coinSide._tag; if (tag == tag2) { return 0; } return tag - tag2; } return 1; } if ((CoinSide)obj != null) { return -1; } return 0; } [CompilerGenerated] public sealed int GetHashCode(IEqualityComparer comp) { return this?._tag ?? 0; } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public sealed bool Equals(object obj, IEqualityComparer comp) { if (this != null) { if (obj is CoinSide coinSide) { int tag = _tag; int tag2 = coinSide._tag; return tag == tag2; } return false; } return obj == null; } [CompilerGenerated] public sealed bool Equals(CoinSide obj) { if (this != null) { if (obj != null) { int tag = _tag; int tag2 = obj._tag; return tag == tag2; } return false; } return obj == null; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is CoinSide obj2) { return Equals(obj2); } return false; } } [CompilationRepresentation(/*Could not decode attribute arguments.*/)] [RequireQualifiedAccess] [CompilationMapping(/*Could not decode attribute arguments.*/)] public static class RandomVariableModule { [Serializable] internal sealed class toUniformDistribution@50<a> : FSharpFunc<a, Outcome<a>> { public int l; [CompilerGenerated] [DebuggerNonUserCode] internal toUniformDistribution@50(int l) { this.l = l; } public override Outcome<a> Invoke(a e) { BigRational bigRational = NumericLiteralN.FromOne(); BigRational bigRational2 = BigRational.FromInt(l); return new Outcome<a>(e, bigRational / bigRational2); } } [Serializable] internal sealed class probability@56<a> : FSharpFunc<Outcome<a>, BigRational> { internal static readonly probability@56<a> @_instance = new probability@56<a>(); [CompilerGenerated] [DebuggerNonUserCode] internal probability@56() { ((FSharpFunc<Outcome<Outcome<a>>, BigRational>)(object)this)..ctor(); } public override BigRational Invoke(Outcome<a> o) { return o.Probability@; } } [Serializable] internal sealed class certainly@59<a> : FSharpFunc<a, IEnumerable<Outcome<a>>> { internal static readonly certainly@59<a> @_instance = new certainly@59<a>(); [CompilerGenerated] [DebuggerNonUserCode] internal certainly@59() { } public override IEnumerable<Outcome<a>> Invoke(a value) { return returnM(value); } } [Serializable] internal sealed class filter@67<a> : FSharpFunc<Outcome<a>, bool> { public FSharpFunc<a, bool> predicate; [CompilerGenerated] [DebuggerNonUserCode] internal filter@67(FSharpFunc<a, bool> predicate) { ((FSharpFunc<Outcome<Outcome<a>>, bool>)(object)this)..ctor(); this.predicate = predicate; } public override bool Invoke(Outcome<a> o) { return predicate.Invoke(o.Value@); } } [Serializable] internal sealed class filterInAnyOrder@71-1<a> : FSharpFunc<a, bool> { public a item; [CompilerGenerated] [DebuggerNonUserCode] internal filterInAnyOrder@71-1(a item) { this.item = item; } public override bool Invoke(a y) { return HashCompare.GenericEqualityIntrinsic<a>(item, y); } } [Serializable] internal sealed class filterInAnyOrder@71-2<a, b> : FSharpFunc<b, bool> where b : IEnumerable<a> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpFunc<a, bool> predicate; [CompilerGenerated] [DebuggerNonUserCode] internal filterInAnyOrder@71-2(FSharpFunc<a, bool> predicate) { ((FSharpFunc<bool, bool>)(object)this)..ctor(); this.predicate = predicate; } public override bool Invoke(b source) { return SeqModule.Exists<a>(predicate, (IEnumerable<a>)(object)source); } } [Serializable] internal sealed class filterInAnyOrder@71<a, b> : FSharpFunc<IEnumerable<Outcome<b>>, a, IEnumerable<Outcome<b>>> where b : IEnumerable<a> { internal static readonly filterInAnyOrder@71<a, b> @_instance = new filterInAnyOrder@71<a, b>(); [CompilerGenerated] [DebuggerNonUserCode] internal filterInAnyOrder@71() { ((FSharpFunc<IEnumerable<Outcome<a>>, IEnumerable<Outcome<b>>, IEnumerable<Outcome<a>>>)(object)this)..ctor(); } public override IEnumerable<Outcome<b>> Invoke(IEnumerable<Outcome<b>> d, a item) { FSharpFunc<a, bool> predicate = new filterInAnyOrder@71-1<a>(item); return filter(new filterInAnyOrder@71-2<a, b>(predicate), d); } } [Serializable] internal sealed class map@76-2<a, b> : FSharpFunc<Outcome<a>, Outcome<b>> { public FSharpFunc<a, b> f; [CompilerGenerated] [DebuggerNonUserCode] internal map@76-2(FSharpFunc<a, b> f) { ((FSharpFunc<Outcome<Outcome<a>>, Outcome<Outcome<b>>>)(object)this)..ctor(); this.f = f; } public override Outcome<b> Invoke(Outcome<a> o) { return new Outcome<b>(f.Invoke(o.Value@), o.Probability@); } } [Serializable] internal sealed class selectOne@79<a> : FSharpFunc<a, bool> { public a e; [CompilerGenerated] [DebuggerNonUserCode] internal selectOne@79(a e) { this.e = e; } public override bool Invoke(a y) { return !HashCompare.GenericEqualityIntrinsic<a>(e, y); } } [Serializable] internal sealed class selectMany@89-1<a> : FSharpFunc<Tuple<FSharpList<a>, IEnumerable<a>>, IEnumerable<Outcome<Tuple<FSharpList<a>, IEnumerable<a>>>>> { public a x; [CompilerGenerated] [DebuggerNonUserCode] internal selectMany@89-1(a x) { ((FSharpFunc<Tuple<FSharpList<Tuple<FSharpList<a>, IEnumerable<a>>>, IEnumerable<Tuple<FSharpList<a>, IEnumerable<a>>>>, IEnumerable<Outcome<Tuple<FSharpList<Tuple<FSharpList<a>, IEnumerable<a>>>, IEnumerable<Tuple<FSharpList<a>, IEnumerable<a>>>>>>>)(object)this)..ctor(); this.x = x; } public override IEnumerable<Outcome<Tuple<FSharpList<a>, IEnumerable<a>>>> Invoke(Tuple<FSharpList<a>, IEnumerable<a>> _arg2) { FSharpList<a> item = _arg2.Item1; IEnumerable<a> item2 = _arg2.Item2; FSharpList<a> item3 = FSharpList<a>.Cons(x, item); return returnM(new Tuple<FSharpList<a>, IEnumerable<a>>(item3, item2)); } } [Serializable] internal sealed class selectMany@88<a> : FSharpFunc<Tuple<a, IEnumerable<a>>, IEnumerable<Outcome<Tuple<FSharpList<a>, IEnumerable<a>>>>> { public int n; [CompilerGenerated] [DebuggerNonUserCode] internal selectMany@88(int n) { ((FSharpFunc<Tuple<Tuple<a, IEnumerable<a>>, IEnumerable<Tuple<a, IEnumerable<a>>>>, IEnumerable<Outcome<Tuple<FSharpList<Tuple<a, IEnumerable<a>>>, IEnumerable<Tuple<a, IEnumerable<a>>>>>>>)(object)this)..ctor(); this.n = n; } public override IEnumerable<Outcome<Tuple<FSharpList<a>, IEnumerable<a>>>> Invoke(Tuple<a, IEnumerable<a>> _arg1) { a item = _arg1.Item1; IEnumerable<a> item2 = _arg1.Item2; return bind<Tuple<FSharpList<a>, IEnumerable<a>>, IEnumerable<Outcome<Tuple<FSharpList<a>, IEnumerable<a>>>>, Tuple<FSharpList<a>, IEnumerable<a>>>(new selectMany@89-1<a>(item), selectMany(n - 1, item2)); } } [Serializable] internal sealed class select@93<a> : FSharpFunc<Tuple<FSharpList<a>, IEnumerable<a>>, FSharpList<a>> { internal static readonly select@93<a> @_instance = new select@93<a>(); [CompilerGenerated] [DebuggerNonUserCode] internal select@93() { ((FSharpFunc<Tuple<FSharpList<Tuple<FSharpList<a>, IEnumerable<a>>>, IEnumerable<Tuple<FSharpList<a>, IEnumerable<a>>>>, FSharpList<Tuple<FSharpList<a>, IEnumerable<a>>>>)(object)this)..ctor(); } public override FSharpList<a> Invoke(Tuple<FSharpList<a>, IEnumerable<a>> x) { return ListModule.Reverse<a>(x.Item1); } } [Serializable] internal sealed class remove@95-1<a> : FSharpFunc<a, bool> { public a v; [CompilerGenerated] [DebuggerNonUserCode] internal remove@95-1(a v) { this.v = v; } public override bool Invoke(a y) { return !HashCompare.GenericEqualityIntrinsic<a>(v, y); } } [Serializable] internal sealed class remove@95<a> : FSharpFunc<a, bool> { public IEnumerable<a> items; [CompilerGenerated] [DebuggerNonUserCode] internal remove@95(IEnumerable<a> items) { this.items = items; } public override bool Invoke(a v) { return SeqModule.ForAll<a>((FSharpFunc<a, bool>)new remove@95-1<a>(v), items); } } [Serializable] internal sealed class remove@95-2<a> : FSharpFunc<IEnumerable<a>, IEnumerable<a>> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public FSharpFunc<a, bool> predicate; [CompilerGenerated] [DebuggerNonUserCode] internal remove@95-2(FSharpFunc<a, bool> predicate) { ((FSharpFunc<IEnumerable<IEnumerable<a>>, IEnumerable<IEnumerable<a>>>)(object)this)..ctor(); this.predicate = predicate; } public override IEnumerable<a> Invoke(IEnumerable<a> source) { return SeqModule.Filter<a>(predicate, source); } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public static IEnumerable<Outcome<CoinSide>> fairCoin => <StartupCode$MathNet-Numerics-FSharp>.$MathNet.Numerics.Probability.fairCoin@64; public static IEnumerable<Outcome<a>> toUniformDistribution<a>(IEnumerable<a> seq) { int l = SeqModule.Length<a>(seq); return SeqModule.Map<a, Outcome<a>>((FSharpFunc<a, Outcome<a>>)new toUniformDistribution@50<a>(l), seq); } public static BigRational probability<a>(IEnumerable<Outcome<a>> dist) { IEnumerable<BigRational> enumerable = SeqModule.Map<Outcome<a>, BigRational>((FSharpFunc<Outcome<a>, BigRational>)probability@56<a>.@_instance, dist); using IEnumerator<BigRational> enumerator = enumerable.GetEnumerator(); BigRational bigRational = BigRational.Zero; while (enumerator.MoveNext()) { BigRational bigRational2 = bigRational; BigRational current = enumerator.Current; bigRational = bigRational2 + current; } return bigRational; } public static FSharpFunc<a, IEnumerable<Outcome<a>>> certainly<a>() { return certainly@59<a>.@_instance; } public static IEnumerable<Outcome<a>> impossible<a>() { return toUniformDistribution((IEnumerable<a>)FSharpList<a>.Empty); } public static IEnumerable<Outcome<int>> fairDice(int sides) { return toUniformDistribution((IEnumerable<int>)SeqModule.ToList<int>(Operators.CreateSequence<int>(OperatorIntrinsics.RangeInt32(1, 1, sides)))); } [CompilationArgumentCounts(new int[] { 1, 1 })] public static IEnumerable<Outcome<a>> filter<a>(FSharpFunc<a, bool> predicate, IEnumerable<Outcome<a>> dist) { return SeqModule.Filter<Outcome<a>>((FSharpFunc<Outcome<a>, bool>)new filter@67<a>(predicate), dist); } [CompilationArgumentCounts(new int[] { 1, 1 })] public static IEnumerable<Outcome<b>> filterInAnyOrder<a, b>(IEnumerable<a> items, IEnumerable<Outcome<b>> dist) where b : IEnumerable<a> { return SeqModule.Fold<a, IEnumerable<Outcome<b>>>((FSharpFunc<IEnumerable<Outcome<b>>, FSharpFunc<a, IEnumerable<Outcome<b>>>>)(object)filterInAnyOrder@71<a, b>.@_instance, dist, items); } [CompilationArgumentCounts(new int[] { 1, 1 })] public static IEnumerable<Outcome<b>> map<a, b>(FSharpFunc<a, b> f, IEnumerable<Outcome<a>> dist) { return SeqModule.Map<Outcome<a>, Outcome<b>>((FSharpFunc<Outcome<a>, Outcome<b>>)new map@76-2<a, b>(f), dist); } public static IEnumerable<Outcome<Tuple<a, IEnumerable<a>>>> selectOne<a>(IEnumerable<a> values) { ListCollector<Tuple<a, IEnumerable<a>>> val = default(ListCollector<Tuple<a, IEnumerable<a>>>); using (IEnumerator<a> enumerator = values.GetEnumerator()) { while (enumerator.MoveNext()) { a current = enumerator.Current; val.Add(new Tuple<a, IEnumerable<a>>(current, SeqModule.Filter<a>((FSharpFunc<a, bool>)new selectOne@79<a>(current), values))); } IEnumerable<Tuple<a, IEnumerable<a>>> enumerable = null; } FSharpList<Tuple<a, IEnumerable<a>>> seq = val.Close(); return toUniformDistribution((IEnumerable<Tuple<a, IEnumerable<a>>>)seq); } [CompilationArgumentCounts(new int[] { 1, 1 })] public static IEnumerable<Outcome<Tuple<FSharpList<a>, IEnumerable<a>>>> selectMany<a>(int n, IEnumerable<a> values) { return n switch { 0 => certainly<Tuple<FSharpList<a>, IEnumerable<a>>>().Invoke(new Tuple<FSharpList<a>, IEnumerable<a>>(FSharpList<a>.Empty, values)), _ => bind<Tuple<a, IEnumerable<a>>, IEnumerable<Outcome<Tuple<FSharpList<a>, IEnumerable<a>>>>, Tuple<FSharpList<a>, IEnumerable<a>>>(new selectMany@88<a>(n), selectOne(values)), }; } [CompilationArgumentCounts(new int[] { 1, 1 })] public static IEnumerable<Outcome<FSharpList<a>>> select<a>(int n, IEnumerable<a> values) { return map(select@93<a>.@_instance, selectMany(n, values)); } public static FSharpFunc<IEnumerable<a>, IEnumerable<a>> remove<a>(IEnumerable<a> items) { FSharpFunc<a, bool> predicate = new remove@95<a>(items); return new remove@95-2<a>(predicate); } } [CompilationMapping(/*Could not decode attribute arguments.*/)] public static RandomVariableBuilder randomVariable => <StartupCode$MathNet-Numerics-FSharp>.$MathNet.Numerics.Probability.randomVariable@36; [CompilationArgumentCounts(new int[] { 1, 1 })] internal static IEnumerable<Outcome<c>> bind<a, b, c>(FSharpFunc<a, b> f, IEnumerable<Outcome<a>> dist) where b : IEnumerable<Outcome<c>> { return SeqModule.Concat<IEnumerable<Outcome<c>>, Outcome<c>>(SeqModule.Map<Outcome<a>, IEnumerable<Outcome<c>>>((FSharpFunc<Outcome<a>, IEnumerable<Outcome<c>>>)new bind@19<a, b, c>(f), dist)); } internal static IEnumerable<Outcome<a>> returnM<a>(a value) { BigRational bigRational = NumericLiteralN.FromOne(); BigRational bigRational2 = NumericLiteralN.FromOne(); return SeqModule.Singleton<Outcome<a>>(new Outcome<a>(value, bigRational / bigRational2)); } } } namespace <StartupCode$MathNet-Numerics-FSharp>.$MathNet.Numerics { internal static class Probability { [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal static readonly MathNet.Numerics.Probability.RandomVariableBuilder randomVariable@36; [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal static readonly IEnumerable<MathNet.Numerics.Probability.Outcome<MathNet.Numerics.Probability.CoinSide>> fairCoin@64; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal static int init@; static Probability() { randomVariable@36 = new MathNet.Numerics.Probability.RandomVariableBuilder(); fairCoin@64 = MathNet.Numerics.Probability.RandomVariableModule.toUniformDistribution((IEnumerable<MathNet.Numerics.Probability.CoinSide>)FSharpList<MathNet.Numerics.Probability.CoinSide>.Cons(MathNet.Numerics.Probability.CoinSide.Heads, FSharpList<MathNet.Numerics.Probability.CoinSide>.Cons(MathNet.Numerics.Probability.CoinSide.Tails, FSharpList<MathNet.Numerics.Probability.CoinSide>.Empty))); } } } namespace MathNet.Numerics { [CompilationRepresentation(/*Could not decode attribute arguments.*/)] [CompilationMapping(/*Could not decode attribute arguments.*/)] public static class FindRootsModule { [Serializable] [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal sealed class tobcl@38-2<a, b> { public FSharpFunc<a, b> f; public tobcl@38-2(FSharpFunc<a, b> f) { this.f = f; base..ctor(); } internal b Invoke(a delegateArg0) { return f.Invoke(delegateArg0); } } [Serializable] internal sealed class ofFunction@82 : FSharpFunc<Unit, FSharpOption<double>> { public double lowerBound; public double upperBound; public FSharpFunc<double, double> f; [CompilerGenerated] [DebuggerNonUserCode] internal ofFunction@82(double lowerBound, double upperBound, FSharpFunc<double, double> f) { this.lowerBound = lowerBound; this.upperBound = upperBound; this.f = f; } public override FSharpOption<double> Invoke(Unit unitVar0) { return bisection(100, 1E-08, lowerBound, upperBound, f); } } [Serializable] internal sealed class ofFunctionDerivative@86 : FSharpFunc<Unit, FSharpOption<double>> { public double lowerBound; public double upperBound; public FSharpFunc<double, double> f; [CompilerGenerated] [DebuggerNonUserCode] internal ofFunctionDerivative@86(double lowerBound, double upperBound, FSharpFunc<double, double> f) { this.lowerBound = lowerBound; this.upperBound = upperBound; this.f = f; } public override FSharpOption<double> Invoke(Unit unitVar0) { return bisection(100, 1E-08, lowerBound, upperBound, f); } } internal static Func<a, b> tobcl<a, b>(FSharpFunc<a, b> f) { return new tobcl@38-2<a, b>(f).Invoke; } [SpecialName] [CompilationArgumentCounts(new int[] { 1, 1 })] internal static FSharpOption<a> op_BarGreaterBar<a>(FSharpOption<a> option, FSharpFunc<Unit, FSharpOption<a>> orElse) { if (option != null) { return FSharpOption<a>.Some(option.Value); } return orElse.Invoke((Unit)null); } [CompilationArgumentCounts(new int[] { 1, 1, 1, 1, 1 })] public static FSharpOption<double> bisection(int maxIterations, double accuracy, double lowerBound, double upperBound, FSharpFunc<double, double> f) { double num = default(double); if (Bisection.TryFindRoot(tobcl<double, double>(f), lowerBound, upperBound, accuracy, maxIterations, ref num)) { return FSharpOption<double>.Some(num); } return null; } [CompilationArgumentCounts(new int[] { 1, 1, 1, 1, 1 })] public static FSharpOption<double> brent(int maxIterations, double accuracy, double lowerBound, double upperBound, FSharpFunc<double, double> f) { double num = default(double); if (Brent.TryFindRoot(tobcl<double, double>(f), lowerBound, upperBound, accuracy, maxIterations, ref num)) { return FSharpOption<double>.Some(num); } return null; } [CompilationArgumentCounts(new int[] { 1, 1, 1, 1, 1, 1 })] public static FSharpOption<double> newtonRaphson(int maxIterations, double accuracy, double lowerBound, double upperBound, FSharpFunc<double, double> f, FSharpFunc<double, double> df) { double num = default(double); if (NewtonRaphson.TryFindRoot(tobcl<double, double>(f), tobcl<double, double>(df), 0.5 * (lowerBound + upperBound), lowerBound, upperBound, accuracy, maxIterations, ref num)) { return FSharpOption<double>.Some(num); } return null; } [CompilationArgumentCounts(new int[] { 1, 1, 1, 1, 1 })] public static FSharpOption<double> newtonRaphsonGuess(int maxIterations, double accuracy, double guess, FSharpFunc<double, double> f, FSharpFunc<double, double> df) { double num = default(double); if (NewtonRaphson.TryFindRoot(tobcl<double, double>(f), tobcl<double, double>(df), guess, double.MinValue, double.MaxValue, accuracy, maxIterations, ref num)) { return FSharpOption<double>.Some(num); } return null; } [CompilationArgumentCounts(new int[] { 1, 1, 1, 1, 1, 1, 1 })] public static FSharpOption<double> newtonRaphsonRobust(int maxIterations, int subdivision, double accuracy, double lowerBound, double upperBound, FSharpFunc<double, double> f, FSharpFunc<double, double> df) { double num = default(double); if (RobustNewtonRaphson.TryFindRoot(tobcl<double, double>(f), tobcl<double, double>(df), lowerBound, upperBound, accuracy, maxIterations, subdivision, ref num)) { return FSharpOption<double>.Some(num); } return null; } [CompilationArgumentCounts(new int[] { 1, 1, 1, 1 })] public static FSharpOption<double[]> broyden(int maxIterations, double accuracy, double[] guess, FSharpFunc<double[], double[]> f) { double[] array = default(double[]); if (Broyden.TryFindRoot(tobcl<double[], double[]>(f), guess, accuracy, maxIterations, ref array)) { return FSharpOption<double[]>.Some(array); } return null; } [CompilationArgumentCounts(new int[] { 1, 1, 1, 1, 1 })] public static FSharpOption<double[]> broydenWithJacobianStep(double jacobianStepSize, int maxIterations, double accuracy, double[] guess, FSharpFunc<double[], double[]> f) { double[] array = default(double[]); if (Broyden.TryFindRootWithJacobianStep(tobcl<double[], double[]>(f), guess, accuracy, maxIterations, jacobianStepSize, ref array)) { return FSharpOption<double[]>.Some(array); } return null; } [CompilationArgumentCounts(new int[] { 1, 1, 1 })] public static FSharpOption<double> ofFunction(double lowerBound, double upperBound, FSharpFunc<double, double> f) { return op_BarGreaterBar(brent(100, 1E-08, lowerBound, upperBound, f), new ofFunction@82(lowerBound, upperBound, f)); } [CompilationArgumentCounts(new int[] { 1, 1, 1, 1 })] public static FSharpOption<double> ofFunctionDerivative(double lowerBound, double upperBound, FSharpFunc<double, double> f, FSharpFunc<double, double> df) { return op_BarGreaterBar(newtonRaphsonRobust(100, 20, 1E-08, lowerBound, upperBound, f, df), new ofFunctionDerivative@86(lowerBound, upperBound, f)); } } } namespace <StartupCode$MathNet-Numerics-FSharp> { internal static class $FindRoots { } } namespace MathNet.Numerics { [CompilationRepresentation(/*Could not decode attribute arguments.*/)] [CompilationMapping(/*Could not decode attribute arguments.*/)] public static class FitModule { [Serializable] internal sealed class lineFunc@48 : FSharpFunc<double, double> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public Func<double, double> arg; [CompilerGenerated] [DebuggerNonUserCode] internal lineFunc@48(Func<double, double> arg) { this.arg = arg; } public override double Invoke(double a) { return arg(a); } } [Serializable] internal sealed class lineThroughOriginFunc@56 : FSharpFunc<double, double> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public Func<double, double> arg; [CompilerGenerated] [DebuggerNonUserCode] internal lineThroughOriginFunc@56(Func<double, double> arg) { this.arg = arg; } public override double Invoke(double a) { return arg(a); } } [Serializable] internal sealed class multiDimFunc@64 : FSharpFunc<double[], double> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public Func<double[], double> arg; [CompilerGenerated] [DebuggerNonUserCode] internal multiDimFunc@64(Func<double[], double> arg) { this.arg = arg; } public override double Invoke(double[] a) { return arg(a); } } [Serializable] internal sealed class polynomialFunc@72 : FSharpFunc<double, double> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public Func<double, double> arg; [CompilerGenerated] [DebuggerNonUserCode] internal polynomialFunc@72(Func<double, double> arg) { this.arg = arg; } public override double Invoke(double a) { return arg(a); } } [Serializable] internal sealed class linear@78-1<a> : FSharpFunc<int, double> { public a[] x; public FSharpFunc<a, double> f; [CompilerGenerated] [DebuggerNonUserCode] internal linear@78-1(a[] x, FSharpFunc<a, double> f) { this.x = x; this.f = f; } public override double Invoke(int i) { return f.Invoke(x[i]); } } [Serializable] internal sealed class linear@78<a> : FSharpFunc<FSharpFunc<a, double>, FSharpList<double>> { public a[] x; [CompilerGenerated] [DebuggerNonUserCode] internal linear@78(a[] x) { ((FSharpFunc<FSharpFunc<FSharpFunc<a, double>, double>, FSharpList<double>>)(object)this)..ctor(); this.x = x; } public override FSharpList<double> Invoke(FSharpFunc<a, double> f) { return ListModule.Initialize<double>(ArrayModule.Length<a>(x), (FSharpFunc<int, double>)new linear@78-1<a>(x, f)); } } [Serializable] internal sealed class linear@79-2 : FSharpFunc<FSharpList<double>, double[]> { internal static readonly linear@79-2 @_instance = new linear@79-2(); [CompilerGenerated] [DebuggerNonUserCode] internal linear@79-2() { } public override double[] Invoke(FSharpList<double> list) { return ListModule.ToArray<double>(list); } } [Serializable] internal sealed class linearFunc@87-1<a> : FSharpFunc<double, Tuple<FSharpFunc<a, double>, double>, double> { public a z; [CompilerGenerated] [DebuggerNonUserCode] internal linearFunc@87-1(a z) { ((FSharpFunc<double, Tuple<FSharpFunc<double, double>, double>, double>)(object)this)..ctor(); this.z = z; } public override double Invoke(double s, Tuple<FSharpFunc<a, double>, double> tupledArg) { FSharpFunc<a, double> item = tupledArg.Item1; double item2 = tupledArg.Item2; return s + item2 * item.Invoke(z); } } [Serializable] internal sealed class linearFunc@87<a> : FSharpFunc<a, double> { public FSharpList<Tuple<FSharpFunc<a, double>, double>> parts; [CompilerGenerated] [DebuggerNonUserCode] internal linearFunc@87(FSharpList<Tuple<FSharpFunc<a, double>, double>> parts) { this.parts = parts; } public override double Invoke(a z) { return ListModule.Fold<Tuple<FSharpFunc<a, double>, double>, double>((FSharpFunc<double, FSharpFunc<Tuple<FSharpFunc<a, double>, double>, double>>)(object)new linearFunc@87-1<a>(z), 0.0, parts); } } [CompilationArgumentCounts(new int[] { 1, 1 })] internal static b tofs<a, b>(Func<a, b> f, a a) { return f(a); } [CompilationArgumentCounts(new int[] { 1, 1 })] public static (double, double) line(double[] x, double[] y) { return Fit.Line(x, y); } [CompilationArgumentCounts(new int[] { 1, 1 })] public static FSharpFunc<double, double> lineFunc(double[] x, double[] y) { Func<double, double> arg = Fit.LineFunc(x, y); return new lineFunc@48(arg); } [CompilationArgumentCounts(new int[] { 1, 1 })] public static double lineThroughOrigin(double[] x, double[] y) { return Fit.LineThroughOrigin(x, y); } [CompilationArgumentCounts(new int[] { 1, 1 })] public static FSharpFunc<double, double> lineThroughOriginFunc(double[] x, double[] y) { Func<double, double> arg = Fit.LineThroughOriginFunc(x, y); return new lineThroughOriginFunc@56(arg); } [CompilationArgumentCounts(new int[] { 1, 1, 1 })] public static double[] multiDim(bool intercept, double[][] x, double[] y) { return Fit.MultiDim(x, y, intercept, (DirectRegressionMethod)0); } [CompilationArgumentCounts(new int[] { 1, 1, 1 })] public static FSharpFunc<double[], double> multiDimFunc(bool intercept, double[][] x, double[] y) { Func<double[], double> arg = Fit.MultiDimFunc(x, y, intercept, (DirectRegressionMethod)0); return new multiDimFunc@64(arg); } [CompilationArgumentCounts(new int[] { 1, 1, 1 })] public static double[] polynomial(int order, double[] x, double[] y) { return Fit.Polynomial(x, y, order, (DirectRegressionMethod)1); } [CompilationArgumentCounts(new int[] { 1, 1, 1 })] public static FSharpFunc<double, double> polynomialFunc(int order, double[] x, double[] y) { Func<double, double> arg = Fit.PolynomialFunc(x, y, order, (DirectRegressionMethod)1); return new polynomialFunc@72(arg); } [CompilationArgumentCounts(new int[] { 1, 1, 1 })] public static FSharpList<double> linear<a>(FSharpList<FSharpFunc<a, double>> functions, a[] x, double[] y) { FSharpList<FSharpList<double>> val = ListModule.Map<FSharpFunc<a, double>, FSharpList<double>>((FSharpFunc<FSharpFunc<a, double>, FSharpList<double>>)new linear@78<a>(x), functions); double[][] array = ListModule.ToArray<double[]>(ListModule.Map<FSharpList<double>, double[]>((FSharpFunc<FSharpList<double>, double[]>)linear@79-2.@_instance, val)); Matrix<double> val2 = Matrix<double>.Build.DenseOfColumnArrays((IEnumerable<double[]>)array); return ListModule.OfArray<double>(val2.QR((QRMethod)1).Solve(Vector<double>.Build.Dense(y)).ToArray()); } [CompilationArgumentCounts(new int[] { 1, 1, 1 })] public static FSharpFunc<a, double> linearFunc<a>(FSharpList<FSharpFunc<a, double>> functions, a[] x, double[] y) { FSharpList<Tuple<FSharpFunc<a, double>, double>> parts = ListModule.Zip<FSharpFunc<a, double>, double>(functions, linear(functions, x, y)); return new linearFunc@87<a>(parts); } } } namespace <StartupCode$MathNet-Numerics-FSharp> { internal static class $Fit { } } namespace MathNet.Numerics { [CompilationRepresentation(/*Could not decode attribute arguments.*/)] [CompilationMapping(/*Could not decode attribute arguments.*/)] public static class DifferentiateModule { [Serializable] [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal sealed class tobcl@39-1<a, b> { public FSharpFunc<a, b> f; public tobcl@39-1(FSharpFunc<a, b> f) { this.f = f; base..ctor(); } internal b Invoke(a delegateArg0) { return f.Invoke(delegateArg0); } } [Serializable] internal sealed class derivativeFunc@44 : FSharpFunc<double, double> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public Func<double, double> arg; [CompilerGenerated] [DebuggerNonUserCode] internal derivativeFunc@44(Func<double, double> arg) { this.arg = arg; } public override double Invoke(double a) { return arg(a); } } [Serializable] internal sealed class firstDerivativeFunc@47 : FSharpFunc<double, double> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public Func<double, double> arg; [CompilerGenerated] [DebuggerNonUserCode] internal firstDerivativeFunc@47(Func<double, double> arg) { this.arg = arg; } public override double Invoke(double a) { return arg(a); } } [Serializable] internal sealed class secondDerivativeFunc@50 : FSharpFunc<double, double> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public Func<double, double> arg; [CompilerGenerated] [DebuggerNonUserCode] internal secondDerivativeFunc@50(Func<double, double> arg) { this.arg = arg; } public override double Invoke(double a) { return arg(a); } } [Serializable] internal sealed class partialDerivativeFunc@53 : FSharpFunc<double[], double> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public Func<double[], double> arg; [CompilerGenerated] [DebuggerNonUserCode] internal partialDerivativeFunc@53(Func<double[], double> arg) { this.arg = arg; } public override double Invoke(double[] a) { return arg(a); } } [Serializable] internal sealed class firstPartialDerivativeFunc@56 : FSharpFunc<double[], double> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public Func<double[], double> arg; [CompilerGenerated] [DebuggerNonUserCode] internal firstPartialDerivativeFunc@56(Func<double[], double> arg) { this.arg = arg; } public override double Invoke(double[] a) { return arg(a); } } [Serializable] [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal sealed class partialDerivative2@58 { public FSharpFunc<double, FSharpFunc<double, double>> f; public partialDerivative2@58(FSharpFunc<double, FSharpFunc<double, double>> f) { this.f = f; base..ctor(); } internal double Invoke(double[] x) { return FSharpFunc<double, double>.InvokeFast<double>(f, x[0], x[1]); } } [Serializable] [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal sealed class partialDerivative2Func@59 { public FSharpFunc<double, FSharpFunc<double, double>> f; public partialDerivative2Func@59(FSharpFunc<double, FSharpFunc<double, double>> f) { this.f = f; base..ctor(); } internal double Invoke(double[] x) { return FSharpFunc<double, double>.InvokeFast<double>(f, x[0], x[1]); } } [Serializable] internal sealed class partialDerivative2Func@59-1 : FSharpFunc<double, double, double> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public Func<double[], double> arg; [CompilerGenerated] [DebuggerNonUserCode] internal partialDerivative2Func@59-1(Func<double[], double> arg) { this.arg = arg; } public override double Invoke(double a, double b) { return arg(new double[2] { a, b }); } } [Serializable] [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal sealed class firstPartialDerivative2@61 { public FSharpFunc<double, FSharpFunc<double, double>> f; public firstPartialDerivative2@61(FSharpFunc<double, FSharpFunc<double, double>> f) { this.f = f; base..ctor(); } internal double Invoke(double[] x) { return FSharpFunc<double, double>.InvokeFast<double>(f, x[0], x[1]); } } [Serializable] [SpecialName] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal sealed class firstPartialDerivative2Func@62 { public FSharpFunc<double, FSharpFunc<double, double>> f; public firstPartialDerivative2Func@62(FSharpFunc<double, FSharpFunc<double, double>> f) { this.f = f; base..ctor(); } internal double Invoke(double[] x) { return FSharpFunc<double, double>.InvokeFast<double>(f, x[0], x[1]); } } [Serializable] internal sealed class firstPartialDerivative2Func@62-1 : FSharpFunc<double, double, double> { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] public Func<double[], double> arg; [CompilerGenerated] [DebuggerNonUserCode] internal firstPartialDerivative2Func@62-1(Func<double[], double> arg) { this.arg = arg; } public override double Invoke(double a, double b) { return arg(new double[2] { a, b }); } } internal static Func<a, b> tobcl<a, b>(FSharpFunc<a, b> f) { return new tobcl@39-1<a, b>(f).Invoke; } [CompilationArgumentCounts(new int[] { 1, 1 })] internal static b tofs<a, b>(Func<a, b> f, a a) { return f(a); } [CompilationArgumentCounts(new int[] { 1, 1, 1 })] internal static b tofs2<a, b>(Func<a[], b> f, a a, a b) { return f(new a[2] { a, b }); } [CompilationArgumentCounts(new int[] { 1, 1, 1 })] public static double derivative(int order, double x, FSharpFunc<double, double> f) { return Differentiate.Derivative(tobcl<double, double>(f), x, order); } [CompilationArgumentCounts(new int[] { 1, 1 })] public static FSharpFunc<double, double> derivativeFunc(int order, FSharpFunc<double, double> f) { Func<double, double> arg = Differentiate.DerivativeFunc(tobcl<double, double>(f), order); return new derivativeFunc@44(arg); } [CompilationArgumentCounts(new int[] { 1, 1 })] public static double firstDerivative(double x, FSharpFunc<double, double> f) { return Differentiate.FirstDerivative(tobcl<double, double>(f), x); } public static FSharpFunc<double, double> firstDerivativeFunc(FSharpFunc<double, double> f) { Func<double, double> arg = Differentiate.FirstDerivativeFunc(tobcl<double, double>(f)); return new firstDerivativeFunc@47(arg); } [CompilationArgumentCounts(new int[] { 1, 1 })] public static double secondDerivative(double x, FSharpFunc<double, double> f) { return Differentiate.SecondDerivative(tobcl<double, double>(f), x); } public static FSharpFunc<double, double> secondDerivativeFunc(FSharpFunc<double, double> f) { Func<double, double> arg = Differentiate.SecondDerivativeFunc(tobcl<double, double>(f)); return new secondDerivativeFunc@50(arg); } [CompilationArgumentCounts(new int[] { 1, 1, 1, 1 })] public static double partialDerivative(int order, int parameterIndex, double[] x, FSharpFunc<double[], double> f) { return Differentiate.PartialDerivative(tobcl<double[], double>(f), x, parameterIndex, order); } [CompilationArgumentCounts(new int[] { 1, 1, 1 })] public static FSharpFunc<double[], double> partialDerivativeFunc(int order, int parameterIndex, FSharpFunc<double[], double> f) { Func<double[], double> arg = Differentiate.PartialDerivativeFunc(tobcl<double[], double>(f), parameterIndex, order); return new partialDerivativeFunc@53(arg); } [CompilationArgumentCounts(new int[] { 1, 1, 1 })] public static double firstPartialDerivative(int parameterIndex, double[] x, FSharpFunc<double[], double> f) { return Differentiate.FirstPartialDerivative(tobcl<double[], double>(f), x, parameterIndex); } [CompilationArgumentCounts(new int[] { 1, 1 })] public static FSharpFunc<double[], double> firstPartialDerivativeFunc(int parameterIndex, FSharpFunc<double[], double> f) { Func<double[], double> arg = Differentiate.FirstPartialDerivativeFunc(tobcl<double[], double>(f), parameterIndex); return new firstPartialDerivativeFunc@56(arg); } [CompilationArgumentCounts(new int[] { 1, 1, 1, 1 })] public static double partialDerivative2(int order, int parameterIndex, double[] x, FSharpFunc<double, FSharpFunc<double, double>> f) { return Differentiate.PartialDerivative((Func<double[], double>)new partialDerivative2@58(f).Invoke, x, parameterIndex, order); } [CompilationArgumentCounts(new int[] { 1, 1, 1 })] public static FSharpFunc<double, FSharpFunc<double, double>> partialDerivative2Func(int order, int parameterIndex, FSharpFunc<double, FSharpFunc<double, double>> f) { Func<double[], double> arg = Differentiate.PartialDerivativeFunc((Func<double[], double>)new partialDerivative2Func@59(f).Invoke, parameterIndex, order); return (FSharpFunc<double, FSharpFunc<double, double>>)(object)new partialDerivative2Func@59-1(arg); } [CompilationArgumentCounts(new int[] { 1, 1, 1 })] public static double firstPartialDerivative2(int parameterIndex, double[] x, FSharpFunc<double, FSharpFunc<double, double>> f) { return Differentiate.FirstPartialDerivative((Func<double[], double>)new firstPartialDerivative2@61(f).Invoke, x, parameterIndex); } [CompilationArgumentCounts(new int[] { 1, 1 })] public static FSharpFunc<double, FSharpFunc<double, double>> firstPartialDerivative2Func(int parameterIndex, FSharpFunc<double, FSharpFunc<double, double>> f) { Func<double[], double> arg = Differentiate.FirstPartialDerivativeFunc((Func<double[], double>)new firstPartialDerivative2Func@62(f).Invoke, parameterIndex); return (FSharpFunc<double, FSharpFunc<double, double>>)(object)new firstPartialDerivative2Func@62-1(arg); } } } namespace <StartupCode$MathNet-Numerics-FSharp> { internal static class $Differentiate { } } namespace MathNet.Numerics { [RequireQualifiedAccess] [CompilationMapping(/*Could not decode attribute arguments.*/)] public static class NumericLiteralN { [CompilationMapping(/*Could not decode attribute arguments.*/)] internal static BigRational zero => $BigRational.zero@485-4; [CompilationMapping(/*Could not decode attribute arguments.*/)] internal static BigRational one => $BigRational.one@486-4; public static BigRational FromZero() { return zero; } public static BigRational FromOne() { return one; } public static BigRational FromInt32(int x) { return BigRational.NewZ(new BigInteger(x)); } public static BigRational FromInt64(long x) { return BigRational.NewZ(new BigInteger(x)); } public static BigRational FromString(string str) { return BigRational.NewQ(BigRationalLarge.Parse(str)); } } } namespace <StartupCode$MathNet-Numerics-FSharp> { internal static class $BigRational { [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal static readonly BigRational zero@485-4; [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal static readonly BigRational one@486-4; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal static int init@; static $BigRational() { zero@485-4 = BigRational.NewZ(new BigInteger(0)); one@486-4 = BigRational.NewZ(new BigInteger(1)); } } } namespace System.Numerics { [AutoOpen] [CompilationMapping(/*Could not decode attribute arguments.*/)] public static class BigIntegerExtensions { [CompilationArgumentCounts(new int[] { 1, 1, 1, 1 })] internal static BigInteger parseImpl(string str, int len, BigInteger acc, int i) { while (true) { if (i == len) { return acc; } int num = str[i] - 48; if (0 > num || num > 9) { break; } string text = str; int num2 = len; BigInteger bigInteger = new BigInteger(10) * acc + new BigInteger(num); i++; acc = bigInteger; len = num2; str = text; } FormatException ex = new FormatException("The value could not be parsed."); throw ex; } public static BigInteger BigInteger.Parse.Static(string str) { int length = str.Length; if (length == 0) { FormatException ex = new FormatException("The value could not be parsed."); throw ex; } if (str[0] == '-') { return -parseImpl(str, length, BigInteger.Zero, 1); } return parseImpl(str, length, BigInteger.Zero, 0); } } } namespace <StartupCode$MathNet-Numerics-FSharp> { internal static class $BigIntegerExtensions { } } namespace MathNet.Numerics { [AutoOpen] [CompilationMapping(/*Could not decode attribute arguments.*/)] public static class ComplexExtensions { [CompilationArgumentCounts(new int[] { 1, 1 })] public static Complex complex(double x, double y) { return new Complex(x, y); } [CompilationArgumentCounts(new int[] { 1, 1 })] public static Complex32 complex32(float x, float y) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return new Complex32(x, y); } [CompilationArgumentCounts(new int[] { 1, 0 })] public static double Complex.get_r(Complex P_0) { return P_0.Real; } [CompilationArgumentCounts(new int[] { 1, 0 })] public static double Complex.get_i(Complex P_0) { return P_0.Imaginary; } public static Complex Complex.Create.Static(double a, double b) { return new Complex(a, b); } public static Complex Complex.CreatePolar.Static(double a, double b) { return Complex.FromPolarCoordinates(a, b); } [CompilationArgumentCounts(new int[] { 1, 0 })] public static float Complex32.get_r(Complex32 P_0) { return ((Complex32)(ref P_0)).Real; } [CompilationArgumentCounts(new int[] { 1, 0 })] public static float Complex32.get_i(Complex32 P_0) { return ((Complex32)(ref P_0)).Imaginary; } public static Complex32 Complex32.Create.Static(float a, float b) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return new Complex32(a, b); } public static Complex32 Complex32.CreatePolar.Static(float a, float b) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return Complex32.FromPolarCoordinates(a, b); } } [RequireQualifiedAccess] [CompilationRepresentation(/*Could not decode attribute arguments.*/)] [CompilationMapping(/*Could not decode attribute arguments.*/)] public static class Complex32Module { [CompilationMapping(/*Could not decode attribute arguments.*/)] public static Complex32 zero => $Complex.zero@209-1; [CompilationMapping(/*Could not decode attribute arguments.*/)] public static Complex32 one => $Complex.one@212-1; [CompilationMapping(/*Could not decode attribute arguments.*/)] public static Complex32 onei => $Complex.onei@215-1; [CompilationMapping(/*Could not decode attribute arguments.*/)] public static Complex32 pi => $Complex.pi@218-1; public static Complex32 mkRect(float a, float b) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return new Complex32(a, b); } public static Complex32 mkPolar(float a, float b) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return Complex32.FromPolarCoordinates(a, b); } public static Complex32 cis(float b) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return Complex32.FromPolarCoordinates(1f, b); } internal static Complex32 ofComplex(Complex x) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) return new Complex32((float)x.Real, (float)x.Imaginary); } public static float realPart(Complex32 c) { return ((Complex32)(ref c)).Real; } public static float imagPart(Complex32 c) { return ((Complex32)(ref c)).Imaginary; } public static float magnitude(Complex32 c) { return ((Complex32)(ref c)).Magnitude; } public static float phase(Complex32 c) { return ((Complex32)(ref c)).Phase; } public static Complex32 neg(Complex32 a) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) return -a; } public static Complex32 conjugate(Complex32 c) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return ((Complex32)(ref c)).Conjugate(); } [CompilationArgumentCounts(new int[] { 1, 1 })] public static Complex32 add(Complex32 a, Complex32 b) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) return a + b; } [CompilationArgumentCounts(new int[] { 1, 1 })] public static Complex32 sub(Complex32 a, Complex32 b) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) return a - b; } [CompilationArgumentCounts(new int[] { 1, 1 })] public static Complex32 mul(Complex32 a, Complex32 b) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) return a * b; } [CompilationArgumentCounts(new int[] { 1, 1 })] public static Complex32 div(Complex32 x, Complex32 y) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) return x / y; } [CompilationArgumentCounts(new int[] { 1, 1 })] public static Complex32 smul(float a, Complex32 b) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) return new Complex32(a * ((Complex32)(ref b)).Real, a * ((Complex32)(ref b)).Imaginary); } [CompilationArgumentCounts(new int[] { 1, 1 })] public static Complex32 muls(Complex32 a, float b) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) return new Complex32(((Complex32)(ref a)).Real * b, ((Complex32)(ref a)).Imaginary * b); } public static Complex32 exp(Complex32 x) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Complex32.Exp(x); } public static Complex32 ln(Complex32 x) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Complex32.Log(x); } public static Complex32 log10(Complex32 x) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Complex32.Log10(x); } [CompilationArgumentCounts(new int[] { 1, 1 })] public static Complex32 log(float b, Complex32 x) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) return Complex32.Log(x, b); } [CompilationArgumentCounts(new int[] { 1, 1 })] public static Complex32 pow(Complex32 power, Complex32 x) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) return Complex32.Pow(x, power); } [CompilationArgumentCounts(new int[] { 1, 1 })] public static Complex32 powf(float power, Complex32 x) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) return Complex32.Pow(x, power); } public static Complex32 sqr(Complex32 x) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return ((Complex32)(ref x)).Square(); } public static Complex32 sqrt(Complex32 x) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return ((Complex32)(ref x)).SquareRoot(); } public static Complex32 sin(Complex32 x) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Complex32.Sin(x); } public static Complex32 cos(Complex32 x) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Complex32.Cos(x); } public static Complex32 tan(Complex32 x) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Complex32.Tan(x); } public static Complex32 cot(Complex32 x) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) Complex complex = Trig.Cot(((Complex32)(ref x)).ToComplex()); return new Complex32((float)complex.Real, (float)complex.Imaginary); } public static Complex32 sec(Complex32 x) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) Complex complex = Trig.Sec(((Complex32)(ref x)).ToComplex()); return new Complex32((float)complex.Real, (float)complex.Imaginary); } public static Complex32 csc(Complex32 x) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) Complex complex = Trig.Csc(((Complex32)(ref x)).ToComplex()); return new Complex32((float)complex.Real, (float)complex.Imaginary); } public static Complex32 asin(Complex32 x) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) Complex complex = Trig.Asin(((Complex32)(ref x)).ToComplex()); return new Complex32((float)complex.Real, (float)complex.Imaginary); } public static Complex32 acos(Complex32 x) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) Complex complex = Trig.Acos(((Complex32)(ref x)).ToComplex()); return new Complex32((float)complex.Real, (float)complex.Imaginary); } public static Complex32 atan(Complex32 x) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Complex32.Atan(x); } public static Complex32 acot(Complex32 x) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) Complex complex = Trig.Acot(((Complex32)(ref x)).ToComplex()); return new Complex32((float)complex.Real, (float)complex.Imaginary); } public static Complex32 asec(Complex32 x) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) Complex complex = Trig.Asec(((Complex32)(ref x)).ToComplex()); return new Complex32((float)complex.Real, (float)complex.Imaginary); } public static Complex32 acsc(Complex32 x) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) Complex complex = Trig.Acsc(((Complex32)(ref x)).ToComplex()); return new Complex32((float)complex.Real, (float)complex.Imaginary); } public static Complex32 sinh(Complex32 x) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Complex32.Sinh(x); } public static Complex32 cosh(Complex32 x) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Complex32.Cosh(x); } public static Complex32 tanh(Complex32 x) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Complex32.Tanh(x); } public static Complex32 coth(Complex32 x) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) Complex complex = Trig.Coth(((Complex32)(ref x)).ToComplex()); return new Complex32((float)complex.Real, (float)complex.Imaginary); } public static Complex32 sech(Complex32 x) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) Complex complex = Trig.Sech(((Complex32)(ref x)).ToComplex()); return new Complex32((float)complex.Real, (float)complex.Imaginary); } public static Complex32 csch(Complex32 x) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) Complex complex = Trig.Csch(((Complex32)(ref x)).ToComplex()); return new Complex32((float)complex.Real, (float)complex.Imaginary); } public static Complex32 asinh(Complex32 x) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) Complex complex = Trig.Asinh(((Complex32)(ref x)).ToComplex()); return new Complex32((float)complex.Real, (float)complex.Imaginary); } public static Complex32 acosh(Complex32 x) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) Complex complex = Trig.Acosh(((Complex32)(ref x)).ToComplex()); return new Complex32((float)complex.Real, (float)complex.Imaginary); } public static Complex32 atanh(Complex32 x) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) Complex complex = Trig.Atanh(((Complex32)(ref x)).ToComplex()); return new Complex32((float)complex.Real, (float)complex.Imaginary); } public static Complex32 acoth(Complex32 x) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) Complex complex = Trig.Acoth(((Complex32)(ref x)).ToComplex()); return new Complex32((float)complex.Real, (float)complex.Imaginary); } public static Complex32 asech(Complex32 x) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) Complex complex = Trig.Asech(((Complex32)(ref x)).ToComplex()); return new Complex32((float)complex.Real, (float)complex.Imaginary); } public static Complex32 acsch(Complex32 x) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) Complex complex = Trig.Acsch(((Complex32)(ref x)).ToComplex()); return new Complex32((float)complex.Real, (float)complex.Imaginary); } } [RequireQualifiedAccess] [CompilationRepresentation(/*Could not decode attribute arguments.*/)] [CompilationMapping(/*Could not decode attribute argument
BepInEx/core/Mirage.Core/SileroVAD/SileroVAD.dll
Decompiled a month agousing System; using System.Collections; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using Microsoft.FSharp.Core; [assembly: FSharpInterfaceDataVersion(2, 0, 0)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("SileroVAD")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+705239c4c3e53ee114396964b0f51a7a4432a856")] [assembly: AssemblyProduct("SileroVAD")] [assembly: AssemblyTitle("SileroVAD")] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default)] [assembly: AssemblyVersion("1.0.0.0")] namespace Silero { [CompilationMapping(/*Could not decode attribute arguments.*/)] public static class API { [Serializable] [StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)] [DebuggerDisplay("{__DebugDisplay(),nq}")] [CompilationMapping(/*Could not decode attribute arguments.*/)] public sealed class SileroVAD : IEquatable<SileroVAD>, IStructuralEquatable, IComparable<SileroVAD>, IComparable, IStructuralComparable { [DebuggerBrowsable(DebuggerBrowsableState.Never)] [CompilerGenerated] [DebuggerNonUserCode] internal readonly IntPtr item; [CompilerGenerated] [DebuggerNonUserCode] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal int Tag { [CompilerGenerated] [DebuggerNonUserCode] get { return 0; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] [CompilerGenerated] [DebuggerNonUserCode] internal IntPtr Item { [CompilerGenerated] [DebuggerNonUserCode] get { return item; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] internal static SileroVAD NewSileroVAD(IntPtr item) { return new SileroVAD(item); } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(SileroVAD))] [CompilerGenerated] [DebuggerNonUserCode] internal SileroVAD(IntPtr item) { this.item = item; } [SpecialName] [CompilerGenerated] [DebuggerNonUserCode] internal object __DebugDisplay() { return ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<SileroVAD, string>>((PrintfFormat<FSharpFunc<SileroVAD, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<SileroVAD, string>, Unit, string, string, string>("%+0.8A")).Invoke(this); } [CompilerGenerated] public override string ToString() { return ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<SileroVAD, string>>((PrintfFormat<FSharpFunc<SileroVAD, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<SileroVAD, string>, Unit, string, string, SileroVAD>("%+A")).Invoke(this); } [CompilerGenerated] public sealed int CompareTo(SileroVAD obj) { if (this != null) { if (obj != null) { IComparer genericComparer = LanguagePrimitives.GenericComparer; IntPtr intPtr = item; IntPtr intPtr2 = obj.item; return (((nint)intPtr > (nint)intPtr2) ? 1 : 0) - (((nint)intPtr < (nint)intPtr2) ? 1 : 0); } return 1; } if (obj != null) { return -1; } return 0; } [CompilerGenerated] public sealed int CompareTo(object obj) { return CompareTo((SileroVAD)obj); } [CompilerGenerated] public sealed int CompareTo(object obj, IComparer comp) { SileroVAD sileroVAD = (SileroVAD)obj; if (this != null) { if ((SileroVAD)obj != null) { SileroVAD sileroVAD2 = sileroVAD; IntPtr intPtr = item; IntPtr intPtr2 = sileroVAD2.item; return (((nint)intPtr > (nint)intPtr2) ? 1 : 0) - (((nint)intPtr < (nint)intPtr2) ? 1 : 0); } return 1; } if ((SileroVAD)obj != null) { return -1; } return 0; } [CompilerGenerated] public sealed int GetHashCode(IEqualityComparer comp) { if (this != null) { int num = 0; num = 0; IntPtr intPtr = item; return -1640531527 + ((int)(nuint)(nint)intPtr + ((num << 6) + (num >> 2))); } return 0; } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public sealed bool Equals(object obj, IEqualityComparer comp) { if (this != null) { if (obj is SileroVAD sileroVAD) { SileroVAD sileroVAD2 = sileroVAD; return item == sileroVAD2.item; } return false; } return obj == null; } [CompilerGenerated] public sealed bool Equals(SileroVAD obj) { if (this != null) { if (obj != null) { return item == obj.item; } return false; } return obj == null; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is SileroVAD obj2) { return Equals(obj2); } return false; } } [Serializable] [CompilationMapping(/*Could not decode attribute arguments.*/)] public enum LogLevel { Verbose, Info, Warning, Error, Fatal } public static SileroVAD SileroVAD(int windowSize) { string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); return API.SileroVAD.NewSileroVAD(Foreign.init_silero(new Foreign.SileroInitParams(Path.Combine(directoryName, "onnxruntime.dll"), Path.Combine(directoryName, "silero_vad.onnx"), 3, 1, Environment.ProcessorCount, windowSize))); } public static void releaseSilero(SileroVAD _arg1) { Foreign.release_silero(_arg1.item); } [CompilationArgumentCounts(new int[] { 1, 1 })] public static float detectSpeech(SileroVAD _arg1, float[] pcmData) { IntPtr item = _arg1.item; return Foreign.detect_speech(item, pcmData, pcmData.Length); } } } namespace <StartupCode$SileroVAD>.$Silero { internal static class API { } } namespace Silero { [CompilationMapping(/*Could not decode attribute arguments.*/)] public static class Foreign { [Serializable] [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] [Struct] [CompilationMapping(/*Could not decode attribute arguments.*/)] internal struct SileroInitParams : IEquatable<SileroInitParams>, IStructuralEquatable, IComparable<SileroInitParams>, IComparable, IStructuralComparable { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal string onnxruntime_path@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal string model_path@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal int log_level@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal int inter_threads@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal int intra_threads@; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal int window_size@; [CompilationMapping(/*Could not decode attribute arguments.*/)] internal readonly string onnxruntime_path { [CompilerGenerated] [DebuggerNonUserCode] get { return onnxruntime_path@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] internal readonly string model_path { [CompilerGenerated] [DebuggerNonUserCode] get { return model_path@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] internal readonly int log_level { [CompilerGenerated] [DebuggerNonUserCode] get { return log_level@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] internal readonly int inter_threads { [CompilerGenerated] [DebuggerNonUserCode] get { return inter_threads@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] internal readonly int intra_threads { [CompilerGenerated] [DebuggerNonUserCode] get { return intra_threads@; } } [CompilationMapping(/*Could not decode attribute arguments.*/)] internal readonly int window_size { [CompilerGenerated] [DebuggerNonUserCode] get { return window_size@; } } [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(SileroInitParams))] internal SileroInitParams(string onnxruntime_path, string model_path, int log_level, int inter_threads, int intra_threads, int window_size) { onnxruntime_path@ = onnxruntime_path; model_path@ = model_path; log_level@ = log_level; inter_threads@ = inter_threads; intra_threads@ = intra_threads; window_size@ = window_size; } [CompilerGenerated] public override string ToString() { return ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<SileroInitParams, string>>((PrintfFormat<FSharpFunc<SileroInitParams, string>, Unit, string, string>)(object)new PrintfFormat<FSharpFunc<SileroInitParams, string>, Unit, string, string, SileroInitParams>("%+A")).Invoke(this); } [CompilerGenerated] public sealed int CompareTo(SileroInitParams obj) { IComparer genericComparer = LanguagePrimitives.GenericComparer; int num = string.CompareOrdinal(onnxruntime_path@, obj.onnxruntime_path@); if (num < 0) { return num; } if (num > 0) { return num; } genericComparer = LanguagePrimitives.GenericComparer; int num2 = string.CompareOrdinal(model_path@, obj.model_path@); if (num2 < 0) { return num2; } if (num2 > 0) { return num2; } genericComparer = LanguagePrimitives.GenericComparer; int num3 = log_level@; int num4 = obj.log_level@; int num5 = ((num3 > num4) ? 1 : 0) - ((num3 < num4) ? 1 : 0); if (num5 < 0) { return num5; } if (num5 > 0) { return num5; } genericComparer = LanguagePrimitives.GenericComparer; num4 = inter_threads@; int num6 = obj.inter_threads@; num3 = ((num4 > num6) ? 1 : 0) - ((num4 < num6) ? 1 : 0); if (num3 < 0) { return num3; } if (num3 > 0) { return num3; } genericComparer = LanguagePrimitives.GenericComparer; num6 = intra_threads@; int num7 = obj.intra_threads@; num4 = ((num6 > num7) ? 1 : 0) - ((num6 < num7) ? 1 : 0); if (num4 < 0) { return num4; } if (num4 > 0) { return num4; } genericComparer = LanguagePrimitives.GenericComparer; num6 = window_size@; num7 = obj.window_size@; return ((num6 > num7) ? 1 : 0) - ((num6 < num7) ? 1 : 0); } [CompilerGenerated] public sealed int CompareTo(object obj) { return CompareTo((SileroInitParams)obj); } [CompilerGenerated] public sealed int CompareTo(object obj, IComparer comp) { SileroInitParams sileroInitParams = (SileroInitParams)obj; int num = string.CompareOrdinal(onnxruntime_path@, sileroInitParams.onnxruntime_path@); if (num < 0) { return num; } if (num > 0) { return num; } int num2 = string.CompareOrdinal(model_path@, sileroInitParams.model_path@); if (num2 < 0) { return num2; } if (num2 > 0) { return num2; } int num3 = log_level@; int num4 = sileroInitParams.log_level@; int num5 = ((num3 > num4) ? 1 : 0) - ((num3 < num4) ? 1 : 0); if (num5 < 0) { return num5; } if (num5 > 0) { return num5; } num4 = inter_threads@; int num6 = sileroInitParams.inter_threads@; num3 = ((num4 > num6) ? 1 : 0) - ((num4 < num6) ? 1 : 0); if (num3 < 0) { return num3; } if (num3 > 0) { return num3; } num6 = intra_threads@; int num7 = sileroInitParams.intra_threads@; num4 = ((num6 > num7) ? 1 : 0) - ((num6 < num7) ? 1 : 0); if (num4 < 0) { return num4; } if (num4 > 0) { return num4; } num6 = window_size@; num7 = sileroInitParams.window_size@; return ((num6 > num7) ? 1 : 0) - ((num6 < num7) ? 1 : 0); } [CompilerGenerated] public sealed int GetHashCode(IEqualityComparer comp) { int num = 0; num = -1640531527 + (window_size@ + ((num << 6) + (num >> 2))); num = -1640531527 + (intra_threads@ + ((num << 6) + (num >> 2))); num = -1640531527 + (inter_threads@ + ((num << 6) + (num >> 2))); num = -1640531527 + (log_level@ + ((num << 6) + (num >> 2))); num = -1640531527 + ((model_path@?.GetHashCode() ?? 0) + ((num << 6) + (num >> 2))); return -1640531527 + ((onnxruntime_path@?.GetHashCode() ?? 0) + ((num << 6) + (num >> 2))); } [CompilerGenerated] public sealed override int GetHashCode() { return GetHashCode(LanguagePrimitives.GenericEqualityComparer); } [CompilerGenerated] public sealed bool Equals(object obj, IEqualityComparer comp) { if (obj is SileroInitParams sileroInitParams) { if (string.Equals(onnxruntime_path@, sileroInitParams.onnxruntime_path@)) { if (string.Equals(model_path@, sileroInitParams.model_path@)) { if (log_level@ == sileroInitParams.log_level@) { if (inter_threads@ == sileroInitParams.inter_threads@) { if (intra_threads@ == sileroInitParams.intra_threads@) { return window_size@ == sileroInitParams.window_size@; } return false; } return false; } return false; } return false; } return false; } return false; } [CompilerGenerated] public sealed bool Equals(SileroInitParams obj) { if (string.Equals(onnxruntime_path@, obj.onnxruntime_path@)) { if (string.Equals(model_path@, obj.model_path@)) { if (log_level@ == obj.log_level@) { if (inter_threads@ == obj.inter_threads@) { if (intra_threads@ == obj.intra_threads@) { return window_size@ == obj.window_size@; } return false; } return false; } return false; } return false; } return false; } [CompilerGenerated] public sealed override bool Equals(object obj) { if (obj is SileroInitParams) { return Equals((SileroInitParams)obj); } return false; } } [Literal] [DebuggerBrowsable(DebuggerBrowsableState.Never)] public const string dll = "SileroVAD.API.dll"; [DllImport("SileroVAD.API.dll")] internal static extern IntPtr init_silero(SileroInitParams _arg1); [DllImport("SileroVAD.API.dll")] internal static extern void release_silero(IntPtr _arg1); [DllImport("SileroVAD.API.dll")] internal static extern float detect_speech(IntPtr _arg1, float[] _arg2, long _arg3); } } namespace <StartupCode$SileroVAD>.$Silero { internal static class Foreign { } internal static class AssemblyInfo { } } namespace <StartupCode$SileroVAD>.$.NETStandard,Version=v2.1 { internal static class AssemblyAttributes { } } namespace System.Diagnostics.CodeAnalysis { [Serializable] [Flags] [CompilerGenerated] [DebuggerNonUserCode] internal enum DynamicallyAccessedMemberTypes { All = -1, None = 0, PublicParameterlessConstructor = 1, PublicConstructors = 3, NonPublicConstructors = 4, PublicMethods = 8, NonPublicMethods = 0x10, PublicFields = 0x20, NonPublicFields = 0x40, PublicNestedTypes = 0x80, NonPublicNestedTypes = 0x100, PublicProperties = 0x200, NonPublicProperties = 0x400, PublicEvents = 0x800, NonPublicEvents = 0x1000, Interfaces = 0x2000 } [CompilerGenerated] internal class DynamicDependencyAttribute : Attribute { [CompilerGenerated] [DebuggerNonUserCode] private DynamicallyAccessedMemberTypes MemberType@; [CompilerGenerated] [DebuggerNonUserCode] private Type Type@; [CompilerGenerated] [DebuggerNonUserCode] public DynamicallyAccessedMemberTypes MemberType { [CompilerGenerated] [DebuggerNonUserCode] get { return MemberType@; } } [CompilerGenerated] [DebuggerNonUserCode] public Type Type { [CompilerGenerated] [DebuggerNonUserCode] get { return Type@; } } [CompilerGenerated] [DebuggerNonUserCode] public DynamicDependencyAttribute(DynamicallyAccessedMemberTypes MemberType, Type Type) { MemberType@ = MemberType; Type@ = Type; } } }