A monadic approach to animating in-place sorting algorithms