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

Monoid (Conc m a) has noncanonical mappend instance #99

Open
philderbeast opened this issue Jul 28, 2022 · 0 comments
Open

Monoid (Conc m a) has noncanonical mappend instance #99

philderbeast opened this issue Jul 28, 2022 · 0 comments

Comments

@philderbeast
Copy link

When compiling with ghc-9.2.3:

unliftio          > /.../UnliftIO/Internals/Async.hs:513:3: warning: [-Wnoncanonical-monoid-instances]
unliftio          >     Noncanonical ‘mappend’ definition detected
unliftio          >     in the instance declaration for ‘Monoid (Conc m a)’.
unliftio          >     ‘mappend’ will eventually be removed in favour of ‘(<>)’
unliftio          >     Either remove definition for ‘mappend’ (recommended) or define as ‘mappend = (<>)’
unliftio          >     See also: https://gitlab.haskell.org/ghc/ghc/-/wikis/proposal/semigroup-monoid
unliftio          >     |
unliftio          > 513 |   mappend = liftA2 mappend

instance (Monoid a, MonadUnliftIO m) => Monoid (Conc m a) where
mempty = pure mempty
{-# INLINE mempty #-}
mappend = liftA2 mappend
{-# INLINE mappend #-}

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

No branches or pull requests

1 participant