Single() , , , . F # Seq . Seq.find, , .Single(), , , .Single() , , , .
" , ", F #:
open System.Linq
let p = userPlaylists.Entries.Single(fun x -> x.Title = "playlistname")
", ", .Single() # - .First() , , .
, Seq.tryFind over Seq.tryPick " ", .
let userPlaylists = request.GetPlaylistsFeed("username")
let p = userPlaylists.Entries |> Seq.tryFind (fun x -> x.Title = "playlistname")
match p with
| Some pl ->
| None ->
, , , ...
request.GetPlaylistsFeed("username").Entries
|> Seq.tryFind (fun x -> x.Title = "playlistname")
|> function
| Some pl ->
// do something with the list
| None ->
// do something else because we didn't find the list
...