Support [<Values>] (#12)

This commit is contained in:
Patrick Stevens
2024-06-04 23:14:23 +01:00
committed by GitHub
parent d30fde69a1
commit 2f9772007a
9 changed files with 271 additions and 27 deletions

15
TestRunner/Seq.fs Normal file
View File

@@ -0,0 +1,15 @@
namespace TestRunner
[<RequireQualifiedAccess>]
module List =
/// Given e.g. [[1,2],[4,5,6]], returns:
/// [1;4] ; [1;5] ; [1;6] ; [2;4] ; [2;5] ; [2;6]
/// in some order.
/// This is like allPairs but more so.
let rec combinations (s : 'a list list) : 'a list list =
match s with
| [] -> [ [] ]
| head :: s ->
let sub = combinations s
head |> List.collect (fun head -> sub |> List.map (fun tail -> head :: tail))