For example, I’d like to find the tuple that has the minimum date. I tried this
let dateRange2 (prices: seq<System.DateTime * float>) =
let tupleWithMinDate = prices |> Seq.min(fun (date, _) -> date)
tupleWithMinDate
Getting a red squiggly under everything right of the pipeline operator. It says “The type ‘(seq <System.DateTime * float> -> ‘a)’ does not support the ‘comparison’ constraint. For example, it does not support the ‘System.IComparable’ interface”
Not sure if returning a generic type is part of the problem – I assumed Seq.min would know to return the type that the sequence is made of.
1 Answer