Skip to content

Instantly share code, notes, and snippets.

View johnbfair's full-sized avatar

John B Fair johnbfair

View GitHub Profile

Keybase proof

I hereby claim:

  • I am johnbfair on github.
  • I am johnbfair (https://keybase.io/johnbfair) on keybase.
  • I have a public key ASBYYNimAjyE2w0U3058IktA-gv6Gn29mg7zqDw_gELZCgo

To claim this, I am signing this object:

@johnbfair
johnbfair / CSharp.cs
Last active August 29, 2015 14:00
C# vs F# reflection over generic types
// Intended to be executed in LINQPad
//using System.Reflection
void Main()
{
TypeImplementsInterfaceFilter(typeof(MySample2), typeof(MySample1<MySample2>)).Dump();
}
public interface ISample<T> { }
@johnbfair
johnbfair / ReflectionTester.fs
Last active August 29, 2015 14:00
Trying to figure out how to retrieve the generic argument to an interface in F#
type ISample'<'T> =
abstract member Sample<'T> : unit -> unit
type SampleTest<'T>() =
interface ISample'<'T> with
member x.Sample<'T>() = ()
open System
open System.Reflection