diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2015-11-24 15:07:08 +0000 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2015-11-24 15:07:08 +0000 |
commit | 5e04c384b02c7418fcaaaa72721d27383f2d464f (patch) | |
tree | 4e927ee3fec12ecca29018aca190364a566a325c /testsuite/tests/monadfail | |
parent | 8dc6da83f43ceb5e595e00fc454111720fe02ec3 (diff) | |
download | haskell-5e04c384b02c7418fcaaaa72721d27383f2d464f.tar.gz |
Simplify the MonadFail code
Simplify and tidy up the MonadFail code.
See TcMatches.tcMonadFailOp
Less, code; and more robust.
This incidentally fixes a bug; see the change
to MonadFailErrors.stderr
Diffstat (limited to 'testsuite/tests/monadfail')
-rw-r--r-- | testsuite/tests/monadfail/MonadFailErrors.stderr | 130 |
1 files changed, 52 insertions, 78 deletions
diff --git a/testsuite/tests/monadfail/MonadFailErrors.stderr b/testsuite/tests/monadfail/MonadFailErrors.stderr index 17807a4be0..8a478eecf3 100644 --- a/testsuite/tests/monadfail/MonadFailErrors.stderr +++ b/testsuite/tests/monadfail/MonadFailErrors.stderr @@ -1,86 +1,60 @@ MonadFailErrors.hs:16:5: error: - Could not deduce (MonadFail m) - arising from a do statement - with the failable pattern ‘Just x’ - from the context: Monad m - bound by the type signature for: - general :: Monad m => m a - at MonadFailErrors.hs:14:12-25 - Possible fix: - add (MonadFail m) to the context of - the type signature for: - general :: Monad m => m a - In a stmt of a 'do' block: Just x <- undefined - In the expression: - do { Just x <- undefined; - undefined } - In an equation for ‘general’: - general - = do { Just x <- undefined; - undefined } + • Could not deduce (MonadFail m) + arising from a do statement + with the failable pattern ‘Just x’ + from the context: Monad m + bound by the type signature for: + general :: Monad m => m a + at MonadFailErrors.hs:14:12-25 + Possible fix: + add (MonadFail m) to the context of + the type signature for: + general :: Monad m => m a + • In a stmt of a 'do' block: Just x <- undefined + In the expression: + do { Just x <- undefined; + undefined } + In an equation for ‘general’: + general + = do { Just x <- undefined; + undefined } MonadFailErrors.hs:30:5: error: - No instance for (MonadFail Identity) - arising from a do statement - with the failable pattern ‘Just x’ - In a stmt of a 'do' block: Just x <- undefined - In the expression: - do { Just x <- undefined; - undefined } - In an equation for ‘identity’: - identity - = do { Just x <- undefined; - undefined } + • No instance for (MonadFail Identity) + arising from a do statement + with the failable pattern ‘Just x’ + • In a stmt of a 'do' block: Just x <- undefined + In the expression: + do { Just x <- undefined; + undefined } + In an equation for ‘identity’: + identity + = do { Just x <- undefined; + undefined } MonadFailErrors.hs:44:5: error: - No instance for (MonadFail (ST s)) - arising from a do statement - with the failable pattern ‘Just x’ - In a stmt of a 'do' block: Just x <- undefined - In the expression: - do { Just x <- undefined; - undefined } - In an equation for ‘st’: - st - = do { Just x <- undefined; - undefined } + • No instance for (MonadFail (ST s)) + arising from a do statement + with the failable pattern ‘Just x’ + • In a stmt of a 'do' block: Just x <- undefined + In the expression: + do { Just x <- undefined; + undefined } + In an equation for ‘st’: + st + = do { Just x <- undefined; + undefined } MonadFailErrors.hs:51:5: error: - No instance for (MonadFail ((->) r)) - arising from a do statement - with the failable pattern ‘Just x’ - In a stmt of a 'do' block: Just x <- undefined - In the expression: - do { Just x <- undefined; - undefined } - In an equation for ‘reader’: - reader - = do { Just x <- undefined; - undefined } - -MonadFailErrors.hs:59:5: error: - No instance for (MonadFail Identity) - arising from a do statement - with the failable pattern ‘Newtype x’ - In a stmt of a 'do' block: Newtype x <- undefined - In the expression: - do { Newtype x <- undefined; - undefined } - In an equation for ‘newtypeMatch’: - newtypeMatch - = do { Newtype x <- undefined; - undefined } - -MonadFailErrors.hs:67:5: error: - No instance for (MonadFail Identity) - arising from a do statement - with the failable pattern ‘Data x’ - In a stmt of a 'do' block: Data x <- undefined - In the expression: - do { Data x <- undefined; - undefined } - In an equation for ‘singleConMatch’: - singleConMatch - = do { Data x <- undefined; - undefined } + • No instance for (MonadFail ((->) r)) + arising from a do statement + with the failable pattern ‘Just x’ + • In a stmt of a 'do' block: Just x <- undefined + In the expression: + do { Just x <- undefined; + undefined } + In an equation for ‘reader’: + reader + = do { Just x <- undefined; + undefined } |