Is it possible, with simple F# pattern matching transformations, to ignore unmatched values without

Posted by Phobis on Stack Overflow See other posts from Stack Overflow or by Phobis
Published on 2010-05-13T18:16:26Z Indexed on 2010/05/13 18:24 UTC
Read the original article Hit count: 250

So, I previously asked this question:

http://stackoverflow.com/questions/2820234/can-someone-help-me-compare-using-f-over-c-in-this-specific-example-ip-address

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).

© Stack Overflow or respective owner

Related posts about F#

Related posts about pattern-matching