Split into cat/bag and st monad versions.