Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
F# decompiled pattern matching
// Decompiled with JetBrains decompiler
// Type: FSharpParts.FSharpParts
// Assembly: FSharpParts, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 54894392-FF35-398D-A745-038392438954
// Assembly location: D:\temp\SharpExperiments\FSharpParts\bin\Debug\FSharpParts.dll
using CSharpParts;
using Microsoft.FSharp.Core;
namespace FSharpParts
{
[CompilationMapping(SourceConstructFlags.Module)]
public static class FSharpParts
{
public static string selector(object obj)
{
object obj1 = obj;
if (obj1 is ClassA)
return "A";
if (obj1 is ClassB)
return "B";
if (obj1 is ClassC)
return "C";
if (obj1 is ClassD)
return "D";
return obj1 is ClassE ? "E" : "?";
}
}
}
namespace FSharpParts
open CSharpParts
module FSharpParts =
let selector (obj: obj) =
match obj with
| :? ClassA -> "A"
| :? ClassB -> "B"
| :? ClassC -> "C"
| :? ClassD -> "D"
| :? ClassE -> "E"
| _ -> "?"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment