Created
May 30, 2012 16:16
-
-
Save colinbull/2837354 to your computer and use it in GitHub Desktop.
polymor[hic decomposition
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type IFoo = | |
abstract Do : unit -> unit | |
type Foo1() = | |
interface IFoo with | |
member x.Do() = () | |
type Foo2() = | |
interface IFoo with | |
member x.Do() = () | |
let list = | |
[ | |
Foo1() :> IFoo; | |
Foo2() :> IFoo; | |
Foo1() :> IFoo; | |
Foo2() :> IFoo; | |
Foo1() :> IFoo; | |
Foo2() :> IFoo; | |
] | |
let result = Seq.groupBy (fun x -> x.GetType().FullName) list |> Seq.map snd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment