diff options
author | Torsten Schmits <git@tryp.io> | 2023-04-28 16:03:29 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2023-05-05 22:05:12 -0400 |
commit | 994bda563604461ffb8454d6e298b0310520bcc8 (patch) | |
tree | 0a1fcdf64102b0b2deb8ac67fe935ab3070df055 /testsuite/tests/profiling/should_run | |
parent | 8f303d27dfdbf4c33af00d1a7802c8398b4a74d2 (diff) | |
download | haskell-994bda563604461ffb8454d6e298b0310520bcc8.tar.gz |
Add structured error messages for GHC.Rename.Module
Tracking ticket: #20115
MR: !10361
This converts uses of `mkTcRnUnknownMessage` to newly added constructors
of `TcRnMessage`.
Only addresses the single warning missing from the previous MR.
Diffstat (limited to 'testsuite/tests/profiling/should_run')
-rw-r--r-- | testsuite/tests/profiling/should_run/T3001-2.hs | 19 | ||||
-rw-r--r-- | testsuite/tests/profiling/should_run/ioprof.hs | 4 |
2 files changed, 10 insertions, 13 deletions
diff --git a/testsuite/tests/profiling/should_run/T3001-2.hs b/testsuite/tests/profiling/should_run/T3001-2.hs index 3767073cc3..79b3729e89 100644 --- a/testsuite/tests/profiling/should_run/T3001-2.hs +++ b/testsuite/tests/profiling/should_run/T3001-2.hs @@ -90,22 +90,20 @@ instance Functor PutM where fmap f m = Put $ let PairS a w = unPut m in PairS (f a) w instance Monad PutM where - return a = Put $ PairS a mempty - m >>= k = Put $ let PairS a w = unPut m PairS b w' = unPut (k a) in PairS b (w `mappend` w') - m >> k = Put $ +instance Applicative PutM where + pure a = Put $ PairS a mempty + (<*>) = ap + + m *> k = Put $ let PairS _ w = unPut m PairS b w' = unPut k in PairS b (w `mappend` w') -instance Applicative PutM where - pure = return - (<*>) = ap - tell :: Builder -> Put tell b = Put $ PairS () b @@ -189,9 +187,6 @@ joinZ bb lb | otherwise = L.Chunk bb lb instance Monad Get where - return a = Get (\s -> (a, s)) - {-# INLINE return #-} - m >>= k = Get (\s -> let (a, s') = unGet m s in unGet (k a) s') {-# INLINE (>>=) #-} @@ -200,7 +195,9 @@ instance MonadFail Get where fail = error "failDesc" instance Applicative Get where - pure = return + pure a = Get (\s -> (a, s)) + {-# INLINE pure #-} + (<*>) = ap getZ :: Get S diff --git a/testsuite/tests/profiling/should_run/ioprof.hs b/testsuite/tests/profiling/should_run/ioprof.hs index 98c7f4e241..4df7899a44 100644 --- a/testsuite/tests/profiling/should_run/ioprof.hs +++ b/testsuite/tests/profiling/should_run/ioprof.hs @@ -10,13 +10,13 @@ newtype M s a = M { unM :: s -> (s,a) } instance Monad (M s) where (M m) >>= k = M $ \s -> case m s of (s',a) -> unM (k a) s' - return a = M $ \s -> (s,a) + instance Functor (M s) where fmap = liftM instance Applicative (M s) where - pure = return + pure a = M $ \s -> (s,a) (<*>) = ap errorM :: String -> M s a |