 unfold a distribution of distributions into one distribution
-- 
unfoldD :: Dist (Dist a) -> Dist a
unfoldD (D d) = D [ (x,p*q) | (d',q) <- d, (x,p) <- unD d' ]


unfoldD :: Dist (Dist a) -> Dist a
unfoldD (D d) = D [ (x,p*q) | (d',q) <- d, (x,p) <- unD d' ]
unfoldD (D d) = D [ (x,p*q) | (d',q) <- d, (x,p) <- unD d' ]