File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -48,10 +48,11 @@ type ToSeq =
4848 #endif
4949 x
5050
51- static member ToSeq ( x : Text.StringBuilder , _ : ToSeq ) = string x :> seq< char>
52- static member ToSeq ( x : string , _ : ToSeq ) = String.toSeq x
53- static member ToSeq ( x : option < 'T >, [<Optional>] _impl : ToSeq ) = match x with Some x -> Seq.singleton x | _ -> Seq.empty
54- static member ToSeq ( x : Id < 'T > , [<Optional>] _impl : ToSeq ) = Seq.singleton x.getValue
51+ static member ToSeq ( x : Text.StringBuilder , _ : ToSeq ) = string x :> seq< char>
52+ static member ToSeq ( x : string , _ : ToSeq ) = String.toSeq x
53+ static member ToSeq ( x : option < 'T > , [<Optional>] _impl : ToSeq ) = match x with Some x -> Seq.singleton x | _ -> Seq.empty
54+ static member ToSeq ( x : voption < 'T >, [<Optional>] _impl : ToSeq ) = match x with ValueSome x -> Seq.singleton x | _ -> Seq.empty
55+ static member ToSeq ( x : Id < 'T > , [<Optional>] _impl : ToSeq ) = Seq.singleton x.getValue
5556
5657 static member inline Invoke ( source : '``Foldable < 'T > ``) : seq < 'T > =
5758 let inline call_2 ( a : ^a , b : ^b ) = (( ^a or ^b ) : ( static member ToSeq : _*_ -> _) b, a)
Original file line number Diff line number Diff line change @@ -25,8 +25,10 @@ module Folds =
2525 #endif
2626 let r1 = set [ 1 .. 3 ] |> fold (+) 0
2727 let r2 = set [ 1 .. 3 ] |> toSeq
28+ let r3 = ValueSome 1 |> toSeq
2829 Assert.AreEqual ( 6 , r1)
2930 CollectionAssert.AreEqual ([ 1 ; 2 ; 3 ], r2)
31+ CollectionAssert.AreEqual ([ 1 ], r3)
3032 #if TEST_ TRACE
3133 CollectionAssert.AreEqual ([ " ToSeq seq" ], Traces.get())
3234 #endif
You can’t perform that action at this time.
0 commit comments