gatlin/tubes

`Alternative` instance for `Source` interleaves sources incorrectly

Opened this issue · 0 comments

mkSrc letter = Source $ each [1..5] >< map show >< map (letter ++)
srcA = mkSrc "A"
srcB = mkSrc "B"
srcC = mkSrc "C"

main = runTube $ sample src >< pour display

Output:

A1
B1
A2
C1
A3
B2
A4
C2
A5
B3
C3
B4
C4
B5
C5

If I were to manually reassociate the <> relations I get the same problem. Each source should be sampled with equal weight.