“This is used to build up the commands sent as part of submit. If you enable the ApplicativeDo extension by adding {-# LANGUAGE ApplicativeDo #-} at the top of your file, you can use do-notation but the individual commands must not depend on each other and the last statement in a do block must be of the form return expr or pure expr.”
The pragma is still needed but you only need it if you actually make use of do notation. E.g., the following works without the pragma because the do is redundant.
submit p $ do createCmd …
This one does not:
submit p $ do
c1 <- createCmd …
c2 <- createCmd
pure (c1, c2)
Further to what @cocreature said, it is only needed for dos associated with Commands. Script (the Action that submit produces in this context) can use do without the pragma.
If you need this pragma and haven’t added it, compilation will fail. Conversely, if you don’t have it and your code is compiling, you don’t need it.