I can't find documentation on this. I need to decompose a Discriminated Union value into some of its components but I also need to use the item as a whole within the body of a function as well.
I can do let matcher = function MyDU(_,b,_) -> b
or let extractor MyDU(_,b,_) = b
but what if I also need the reference to the MyDU value for something like ... -> RedundantWrapper(myDU, b)
I've tried:
let extractor myDU =
let MyDU(_,b,_) = myDU
RedundantWrapper(myDU, b)
but I don't think that is the right syntax. Perhaps I can do this some longer way, but it seems like there would be a short way.
Thanks!
Like this: