obsidiansystems / dependent-sum

Dependent sums and supporting typeclasses for comparing and displaying them
54 stars 39 forks source link

Prefer canonical return definition #60

Closed fendor closed 3 years ago

fendor commented 3 years ago

With GHC 9.2 the following warning is shown:

src/Data/GADT/Compare/TH.hs:79:5: warning: [-Wnoncanonical-monad-instances]
    Noncanonical ‘return’ definition detected
    in the instance declaration for ‘Monad (GComparing a b)’.
    ‘return’ will eventually be removed in favour of ‘pure’
    Either remove definition for ‘return’ (recommended) or define as ‘return = pure’
    See also: https://gitlab.haskell.org/ghc/ghc/-/wikis/proposal/monad-of-no-return
   |
79 |     return = GComparing . Right
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Data/GADT/Compare/TH.hs:83:5: warning: [-Wnoncanonical-monad-instances]
    Noncanonical ‘pure = return’ definition detected
    in the instance declaration for ‘Applicative (GComparing a b)’.
    Move definition from ‘return’ to ‘pure’
    See also: https://gitlab.haskell.org/ghc/ghc/-/wikis/proposal/monad-of-no-return
   |
83 |     pure = return
   | 

We fix it here so no one else has to later