Add replicatePrimM and specialise replicateM