1 people like it.
Like the snippet!
Wrapped Class/Interface
Wrapped Class/Interface
Remark: better this way - see example
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
|
namespace Foo
module Collection =
let add (set:System.Collections.Generic.ICollection<_>) item =
set.Add(item) |> ignore
// EXAMPLE
let testSet = new System.Collections.Generic.HashSet<_>()
let test = [1..10] |> List.iter (add testSet)
|
val add : set:System.Collections.Generic.ICollection<'a> -> item:'a -> unit
Full name: Foo.Collection.add
val set : System.Collections.Generic.ICollection<'a>
namespace System
namespace System.Collections
namespace System.Collections.Generic
type ICollection<'T> =
member Add : item:'T -> unit
member Clear : unit -> unit
member Contains : item:'T -> bool
member CopyTo : array:'T[] * arrayIndex:int -> unit
member Count : int
member IsReadOnly : bool
member Remove : item:'T -> bool
Full name: System.Collections.Generic.ICollection<_>
val item : 'a
System.Collections.Generic.ICollection.Add(item: 'a) : unit
val ignore : value:'T -> unit
Full name: Microsoft.FSharp.Core.Operators.ignore
val testSet : System.Collections.Generic.HashSet<int>
Full name: Foo.Collection.testSet
Multiple items
type HashSet<'T> =
new : unit -> HashSet<'T> + 3 overloads
member Add : item:'T -> bool
member Clear : unit -> unit
member Comparer : IEqualityComparer<'T>
member Contains : item:'T -> bool
member CopyTo : array:'T[] -> unit + 2 overloads
member Count : int
member ExceptWith : other:IEnumerable<'T> -> unit
member GetEnumerator : unit -> Enumerator<'T>
member GetObjectData : info:SerializationInfo * context:StreamingContext -> unit
...
nested type Enumerator
Full name: System.Collections.Generic.HashSet<_>
--------------------
System.Collections.Generic.HashSet() : unit
System.Collections.Generic.HashSet(comparer: System.Collections.Generic.IEqualityComparer<'T>) : unit
System.Collections.Generic.HashSet(collection: System.Collections.Generic.IEnumerable<'T>) : unit
System.Collections.Generic.HashSet(collection: System.Collections.Generic.IEnumerable<'T>, comparer: System.Collections.Generic.IEqualityComparer<'T>) : unit
val test : unit
Full name: Foo.Collection.test
Multiple items
module List
from Microsoft.FSharp.Collections
--------------------
type List<'T> =
| ( [] )
| ( :: ) of Head: 'T * Tail: 'T list
interface IEnumerable
interface IEnumerable<'T>
member Head : 'T
member IsEmpty : bool
member Item : index:int -> 'T with get
member Length : int
member Tail : 'T list
static member Cons : head:'T * tail:'T list -> 'T list
static member Empty : 'T list
Full name: Microsoft.FSharp.Collections.List<_>
val iter : action:('T -> unit) -> list:'T list -> unit
Full name: Microsoft.FSharp.Collections.List.iter
More information