Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert C# HashSet to F# Set

Tags:

c#

.net

f#

I have code that is shared between F# and C# and I need to convert between the C# HashSet and the F# Set. Is there an easy way to do this?

like image 574
Paul Nikonowicz Avatar asked Mar 27 '12 18:03

Paul Nikonowicz


1 Answers

there are additional constraints on the types used for a F#-Set - if you can support them you can just use Set.ofSeq to convert it from your HashSet - but I would just use the original HashSet (maybe encapsulated) - no need for the additional work.

like image 53
Random Dev Avatar answered Oct 18 '22 10:10

Random Dev