Better yielding tuple-d union case values in list generation I have a situation where I'm stitching three different unions into a triplet tuple for building a map/dictionary of strongly typed values keyed on a string. 

One of the union cases is very large, the second has three options, and the third has only two. Right now I loop through the large with reflection, and have six yield statements to handle the combinations of the second and third unions. 

My code works fine as far as I can tell so far, but I don't quite like having yield in my code six times. How can I better represent this situation? 

*If needed I can post the code for the unions too. 

**Note that (RawOreName ore).Value is just a string.

let OreDataMap = 
    [
        for oreType in FSharpType.GetUnionCases typeof&lt;EveOnline.OreDomain.Types.OreType&gt; do
            let ore = FSharpValue.MakeUnion (oreType, [| |]) |&gt; unbox

            yield (RawOreName ore).Value, (ore, Common, IsCompressed)
            yield (RawOreName ore).Value, (ore, Uncommon, IsCompressed)
            yield (RawOreName ore).Value, (ore, Rare, IsCompressed)
            yield (RawOreName ore).Value, (ore, Common, IsNotCompressed)
            yield (RawOreName ore).Value, (ore, Uncommon, IsNotCompressed)
            yield (RawOreName ore).Value, (ore, Rare, IsNotCompressed)
    ]
    |&gt; Map.ofList
Why not use nested loops?

let OreDataMap = 
    [
        for common in [ Common; Uncommon; Rare ] do
            for compressed in [ IsCompressed; IsNotCompressed] do
                for oreType in FSharpType.GetUnionCases typeof&lt;EveOnline.OreDomain.Types.OreType&gt; do
                    let ore = FSharpValue.MakeUnion (oreType, [| |]) |&gt; unbox
                    yield (RawOreName ore).Value, (ore, common, compressed)
    ]
    |&gt; Map.ofList


That's probably the idiomatic way, but if you don't like excessive indentation you can always align your successive for loops - I think this looks nicer. Also, you can replace the last do with -&gt; to eliminate the need for the yield keyword.

let OreDataMap = 
    [
        for common in [ Common; Uncommon; Rare ] do
        for compressed in [ IsCompressed; IsNotCompressed] do
        for oreType in FSharpType.GetUnionCases typeof&lt;EveOnline.OreDomain.Types.OreType&gt; -&gt;
            let ore = FSharpValue.MakeUnion (oreType, [| |]) |&gt; unbox
            (RawOreName ore).Value, (ore, common, compressed)
    ]
    |&gt; Map.ofList