Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/default_typeclass: move def of return to pure #188

Merged
merged 2 commits into from
Jun 15, 2021

Conversation

andreasabel
Copy link
Member

@andreasabel andreasabel commented Jun 15, 2021

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’

PR ready, merge after squashing.

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’
Requires additional Functor constraints for older GHC versions.
@Ericson2314 Ericson2314 merged commit ef34928 into haskell:master Jun 15, 2021
@andreasabel andreasabel deleted the testsuite-canonical-return branch October 18, 2023 14:10
@andreasabel andreasabel self-assigned this Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants