A compiler to transform pyramid of callback into sequence of Dues