These are chat archives for Microsoft/visualfsharp

7th
Dec 2016
Kevin Avignon
@Kavignon
Dec 07 2016 03:24
How would one make this code more functional :
I know I should use an equivalent to the Zip extension function in C#, but there aren't any in F# ? The two list are uneven
| MultipleRemovalFromTransaction isList ->
if (isInOperationMode state Sell |> optionDefaultsToValue <| false) = true then
let list = state.Transaction.StoreStock
let exclusionList = isList
let mutable remainingItemStacks = list
            for exItem in exclusionList do 
                remainingItemStacks <- remainingItemStacks |> Array.filter(fun item -> item <> exItem)
bleis-tift
@bleis-tift
Dec 07 2016 03:32
state.Transaction.StoreStock
|> Array.filter (fun item -> exclusionList |> Seq.contains item |> not)
Kevin Avignon
@Kavignon
Dec 07 2016 04:15
I read the code and makes sense, but I do not have access to Seq.contains. I had to go with exists which precisely do the same thing I know. But I can't access contains from VS Community 2015 with .NET 4.6 from neither Array List or Seq
thanks for the help mate @bleis-tift