Moving the definition of the return of the StateT monad to the
Applicative instance, to pure, fixes these warnings (which fail the
testsuite under -Werror=noncanonical-monad-instances):
Noncanonical ‘return’ definition detected
in the instance declaration for ‘Monad (StateT s m)’.
‘return’ will eventually be removed in favour of ‘pure’
Either remove definition for ‘return’ (recommended) or define as ‘return = pure’
Noncanonical ‘pure = return’ definition detected
in the instance declaration for ‘Applicative (StateT s m)’.
Move definition from ‘return’ to ‘pure’
Moving the definition of the
return
of the StateT monad to theApplicative
instance, topure
, fixes these warnings (which fail the testsuite under-Werror=noncanonical-monad-instances
):PR ready, merge after squashing.