@@ -23,8 +23,8 @@ module internal Extensions =
2323 member this.MD5Hash () =
2424 Encoding.UTF8.GetBytes( this)
2525 |> MD5.Create() .ComputeHash
26- |> Array .map _. ToString( " x2" )
27- |> Array .reduce (+)
26+ |> Seq .map _. ToString( " x2" )
27+ |> Seq .reduce (+)
2828
2929/// Basic operations on lists.
3030module internal List =
@@ -35,12 +35,11 @@ module internal List =
3535 let combinations ( input : 'T list ) =
3636 let rec helper ( input : 'T list ) ( startIndex : int ) ( length : int ) =
3737 let mutable combinations = List< List< 'T>>()
38- if length = 2
39- then
38+ if length = 2 then
4039 let mutable combinationsIndex = 0
4140 for inputIndex = startIndex to ( input.Length - 1 ) do
4241 for i = ( inputIndex + 1 ) to ( input.Length - 1 ) do
43- combinations.Add( List< 'T>())
42+ combinations.Add ( List< 'T>())
4443 combinations.[ combinationsIndex]. Add( input.[ inputIndex])
4544 while combinations.[ combinationsIndex]. Count < length do
4645 combinations.[ combinationsIndex]. Add( input.[ i])
@@ -53,17 +52,17 @@ module internal List =
5352 for index = 0 to ( combinations.Count - 1 ) do
5453 combinations.[ index]. Insert( 0 , input.[ i])
5554 for y = 0 to ( combinations.Count - 1 ) do
56- combinationsOfMore.Add( combinations.[ y])
55+ combinationsOfMore.Add ( combinations.[ y])
5756 combinationsOfMore
5857 let output = List< List< 'T>>()
59- output.Add( List< 'T>())
58+ output.Add ( List< 'T>())
6059 for i = 0 to ( input.Length - 1 ) do
6160 let item = List< 'T>()
62- item.Add( input.[ i])
63- output.Add( item)
61+ item.Add ( input.[ i])
62+ output.Add ( item)
6463 for i = 2 to input.Length do
6564 helper input 0 i |> output.AddRange
6665 output
6766 |> Seq.map List.ofSeq
68- |> List.ofSeq
69- |> List.map ( fun x -> x , List.except x input )
67+ |> Seq.map ( fun x -> x , List.except x input )
68+ |> Seq.toList
0 commit comments