haskell / alex

A lexical analyser generator for Haskell
https://hackage.haskell.org/package/alex
BSD 3-Clause "New" or "Revised" License
298 stars 82 forks source link

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

Closed andreasabel closed 3 years ago

andreasabel commented 3 years ago

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.