Skip to content

Commit 07cd877

Browse files
committed
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 75bed4b commit 07cd877

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Control/Monad/Ghc.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ newtype GhcT m a = GhcT { unGhcT :: GHC.GhcT (MTLAdapter m) a }
3535
deriving (Functor, Monad, GHC.HasDynFlags)
3636

3737
instance (Functor m, Monad m) => Applicative (GhcT m) where
38-
pure = return
38+
pure = GhcT . pure
3939
(<*>) = ap
4040

4141
-- adapted from https://github.com/ghc/ghc/blob/ghc-8.2/compiler/main/GHC.hs#L450-L459

src/Hint/InterpreterT.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,5 +196,5 @@ instance (MonadIO m, MonadMask m, Functor m) => MonadInterpreter (InterpreterT m
196196
runGhc = runGhcImpl
197197

198198
instance (Monad m) => Applicative (InterpreterT m) where
199-
pure = return
199+
pure = InterpreterT . pure
200200
(<*>) = ap

0 commit comments

Comments
 (0)