Reimplement specialisation of monadic functions