So, I previously asked this question:
Can someone help me compare using F# over C# in this specific example (IP Address expressions)?
I was looking at the posted code and I was wondering if this code could be written without it producing a warning:
let [|a;b;c;d|] = s.Split [|'.'|]
IP(parseOrParts a, parseOrParts b, parseOrParts c, parseOrParts d)
Is it possible to do something for the match _ pattern ot ignore? Without adding in something like Active Patterns? i want to keep the code as simple as possible… can I do this without drastically changing this code?
NOTE: Warning is as follows
Warning Incomplete pattern matches on this expression. For example, the value ‘[|_; _; _; _; _|]’ may indicate a case not covered by the pattern(s).
You might try
before the partial function.
But of course you’re disabling a warning, and I think this turns it off for the whole file. I remember seeing a way to disable warnings for only part of a file, but I can’t find it right now.
There is also the compiler option
--nowarn:25, but this is even worse since it applies to the whole project.To do this the Right Way, you need to replace your two lines with three: