Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 1.11 KB | None | 0 0
  1. type Result<'TSuccess, 'TFailure> =
  2.   | Success of 'TSuccess
  3.  | Failure of 'TFailure
  4.  
  5.  
  6.  
  7. let private getFiles path =
  8.   try
  9.     Success <| Directory.GetFiles path
  10.   with exn ->
  11.     Failure exn.Message
  12.  
  13.  
  14. let unravel list =
  15.   let rec loop ls xs ys =
  16.     match ls with
  17.     | [] ->
  18.       ( xs, ys )
  19.  
  20.     | ( Success x ) :: tl ->
  21.       loop tl ( x :: xs ) ys
  22.  
  23.     | ( Failure y ) :: tl ->
  24.       loop tl xs ( y :: ys )
  25.   in
  26.     loop list [] []
  27.  
  28.  
  29. let getTitleList () =
  30.   [ @"\\10.84.12.209\mcvod\sdi_ipvod\"
  31.   ; @"\\10.84.12.209\mcvod\hdi_ipvod\"
  32.  
  33.   ; @"x:\encoded2\"
  34.   ; @"x:\encoded2\mcvod\archive\"
  35.  
  36.   ; @"y:\mcvod_mezzanine\sdi_ipvod\archive\"
  37.   ; @"y:\mcvod_mezzanine\sdi_ipvod\archive\april_2012\"
  38.   ; @"y:\mcvod_mezzanine\sdi_ipvod\archive\may_2012\"
  39.   ; @"y:\mcvod_mezzanine\sdi_ipvod\bad\logged\"
  40.  
  41.   ; @"y:\mcvod_mezzanine\hdi_ipvod\archive\"
  42.   ; @"y:\mcvod_mezzanine\hdi_ipvod\archive\failed_qa\"
  43.   ; @"y:\mcvod_mezzanine\hdi_ipvod\baton\"
  44.   ; @"y:\mcvod_mezzanine\hdi_ipvod\hold\"
  45.   ; @"y:\mcvod_mezzanine\hdi_ipvod\transcode_needed\hdp_surround\"
  46.   ]
  47.   |> List.map getFiles
  48.   |> unravel
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement