Опакечивание gsscoder/commandline

Разработка на C# для Gentoo
F# в проектах на C#
1) Для начала, попробуем найти те три файла (которые устанавливаются при помощи paket ?)
EnumerableExtensions.cs, Maybe.cs, ErrorHandling.cs

2) неясно, для чего подключается FSharp.Core.dll
FSharpOption<>
https://fsharpforfunandprofit.com/posts/the-option-type/
Это такой обобщённый Nullable<T>
https://github.com/fsharp/fsharp/blob/89cec79dd516c2eac8d112454a21b31d6f3aa273/src/fsharp/FSharp.Core/prim-types.fs#L3428
https://www.codeproject.com/Articles/743859/Fsharp-Option-types
//-------------------------------------------------------------------------
// Options
//-------------------------------------------------------------------------
[<DefaultAugmentation(false)>]
#if !FX_NO_DEBUG_DISPLAYS
[<DebuggerDisplay("Some({Value})")>]
#endif
[<CompilationRepresentation(CompilationRepresentationFlags.UseNullAsTrueValue)>]
[<CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId="Option")>]
[<StructuralEquality; StructuralComparison>]
[<CompiledName("FSharpOption`1")>]
type Option<'T> =
| None : 'T option
| Some : Value:'T -> 'T option
[<CompilationRepresentation(CompilationRepresentationFlags.Instance)>]
member x.Value = match x with Some x -> x | None -> raise (new System.InvalidOperationException("Option.Value"))
#if !FX_NO_DEBUG_DISPLAYS
[<DebuggerBrowsable(DebuggerBrowsableState.Never)>]
#endif
member x.IsNone = match x with None -> true | _ -> false
#if !FX_NO_DEBUG_DISPLAYS
[<DebuggerBrowsable(DebuggerBrowsableState.Never)>]
#endif
member x.IsSome = match x with Some _ -> true | _ -> false
#if !FX_NO_DEBUG_DISPLAYS
[<DebuggerBrowsable(DebuggerBrowsableState.Never)>]
#endif
static member None : 'T option = None
static member Some(x) : 'T option = Some(x)
static member op_Implicit(x) : 'T option = Some(x)
override x.ToString() =
// x is non-null, hence Some
"Some("^anyToStringShowingNull x.Value^")"
and 'T option = Option<'T>


У меня возникла проблема с написанием свойств IsSome и IsNone. Эти свойства как бы статические, однако принимают на вход объект.

Вот код, который использует:
public static bool IsSome(object value)
{
    return (bool)typeof(FSharpOption<>)
        .MakeGenericType(GetUnderlyingType(value.GetType()))
        .StaticMethod(
            "get_IsSome", value);
}

Как если бы это были расширяющие-методы (extension methods).
однако, если я делаю
public static bool get_IsSome (this FSharpOption o) { return o != null; }
получаю
FSharpOption.cs(22,22): Error CS1106: `Microsoft.FSharp.Core.FSharpOption.get_IsSome(this Microsoft.FSharp.Core.FSharpOption)': Extension methods must be defined in a non-generic static class (CS1106) (CommandLine)

public class Sample
{
    public void Example(string typeName)
    {
        Type myType = FindType(typeName);

        // What goes here to call GenericMethod<T>()?
        GenericMethod<myType>(); // This doesn't work

        // What changes to call StaticMethod<T>()?
        Sample.StaticMethod<myType>(); // This also doesn't work
    }

    public void GenericMethod<T>()
    {
        // ...
    }

    public static void StaticMethod<T>()
    {
        //...
    }
}

using System;
using System.Collections;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

namespace Microsoft.FSharp.Core
{
	[StructLayout(LayoutKind.Auto, CharSet = CharSet.Auto)]
	public sealed class FSharpOption<T> : IEquatable<FSharpOption<T>>, IStructuralEquatable, IComparable<FSharpOption<T>>, IComparable, IStructuralComparable
	{
		T thisValue;
		public T Value
		{
			get
			{
				return thisValue;
			}
		}

		public static FSharpOption<T> Some(T value)
		{
			return new FSharpOption<T>(value);
		}

		public static FSharpOption<T> None
		{
			get
			{
				return null;
			}
		}

		public FSharpOption(T value)
		{
			thisValue = value;
		}

		public bool IsNone
		{
			get
			{
				return this == null;
			}
		}

		public bool IsSome<T>
		{
			get
			{
				return this != null;
			}
		}

		public static int GetTag(FSharpOption<T> fSharpOption)
		{
			return (fSharpOption == null) ? 0 : 1;
		}

		public /*sealed override*/ int CompareTo(object obj, IComparer comp)
		{
			throw new NotImplementedException();
		}

		public /*sealed override*/ int CompareTo(object obj)
		{
			return this.CompareTo((FSharpOption<T>)obj);
		}

		public /*sealed override*/ int CompareTo(FSharpOption<T> obj)
		{
			throw new NotImplementedException();
		}

		public /*sealed override*/ bool Equals(FSharpOption<T> obj)
		{
			throw new NotImplementedException();
		}

		public /*sealed override*/ bool Equals(object obj, IEqualityComparer comp)
		{
			throw new NotImplementedException();
		}

		public sealed override bool Equals(object obj)
		{
			throw new NotImplementedException();
		}

		public /*sealed override*/ int GetHashCode(IEqualityComparer comp)
		{
			throw new NotImplementedException();
		}

		public sealed override int GetHashCode()
		{
			throw new NotImplementedException();
		}

		public override string ToString()
		{
			throw new NotImplementedException();
		}
	}
}