Skip to content

Commit 6f19422

Browse files
rhendrictakano-akio
authored andcommitted
Remove noncanonical definitions
This appeases the -Wnoncanonical-monad-instances warning. This warning exists because a future GHC release may treat noncanonical definitions as errors. See also: https://gitlab.haskell.org/ghc/ghc/-/wikis/proposal/monad-of-no-return
1 parent f8b5fbc commit 6f19422

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Data/ByteString/FastBuilder/Internal.hs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,11 @@ newtype BuildM a = BuildM { runBuildM :: (a -> Builder) -> Builder }
221221
deriving (Functor)
222222

223223
instance Applicative BuildM where
224-
pure = return
224+
pure x = BuildM $ \k -> k x
225+
{-# INLINE pure #-}
225226
(<*>) = ap
226227

227228
instance Monad BuildM where
228-
return x = BuildM $ \k -> k x
229-
{-# INLINE return #-}
230229
BuildM b >>= f = BuildM $ \k -> b $ \r -> runBuildM (f r) k
231230
{-# INLINE (>>=) #-}
232231

0 commit comments

Comments
 (0)