[GHC] #8501: Improve error message when using rec/mdo keyword without RecursiveDo extention.

#8501: Improve error message when using rec/mdo keyword without RecursiveDo extention. -------------------------------------+------------------------------------- Reporter: shelarcy | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler (Parser) | Version: 7.6.3 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #3968 | -------------------------------------+------------------------------------- GHC shows unhelpful error message when using rec keyword and/or mdo keyword without RecursiveDo extention. {{{ module NoRecursiveDo where foo = do rec str <- return "foo" putStrLn str }}} {{{ $ ghc -c NoRecursiveDo.hs NoRecursiveDo1.hs:4:5: Parse error in pattern: rec }}} {{{ module NoRecursiveDo2 where bar = mdo str <- return "bar" putStrLn str }}} {{{ $ ghc -c NoRecursiveDo2.hs NoRecursiveDo2.hs:4:9: parse error on input `<-' }}} {{{ module NoRecursiveDo3 where baz = mdo putStrLn "baz" }}} {{{ $ ghc -c NoRecursiveDo3.hs NoRecursiveDo3.hs:3:7: Not in scope: `mdo' Perhaps you meant `mod' (imported from Prelude) }}} I think that GHC should suggest to use RecursiveDo extention when using mdo/rec keyword. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8501 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8501: Improve error message when using rec/mdo keyword without RecursiveDo extention. -------------------------------------+------------------------------------- Reporter: shelarcy | Owner: Type: feature | Status: new request | Milestone: Priority: normal | Version: 7.6.3 Component: Compiler | Keywords: (Parser) | Architecture: Unknown/Multiple Resolution: | Difficulty: Unknown Operating System: | Blocked By: Unknown/Multiple | Related Tickets: #3968 Type of failure: | None/Unknown | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Description changed by thomie: Old description:
GHC shows unhelpful error message when using rec keyword and/or mdo keyword without RecursiveDo extention.
{{{ module NoRecursiveDo where
foo = do rec str <- return "foo" putStrLn str }}}
{{{ $ ghc -c NoRecursiveDo.hs
NoRecursiveDo1.hs:4:5: Parse error in pattern: rec
}}}
{{{ module NoRecursiveDo2 where
bar = mdo str <- return "bar" putStrLn str }}}
{{{ $ ghc -c NoRecursiveDo2.hs
NoRecursiveDo2.hs:4:9: parse error on input `<-'
}}}
{{{ module NoRecursiveDo3 where
baz = mdo putStrLn "baz" }}}
{{{ $ ghc -c NoRecursiveDo3.hs
NoRecursiveDo3.hs:3:7: Not in scope: `mdo' Perhaps you meant `mod' (imported from Prelude)
}}}
I think that GHC should suggest to use RecursiveDo extention when using mdo/rec keyword.
New description: GHC shows unhelpful error message when using rec keyword and/or mdo keyword without RecursiveDo extention. {{{ module NoRecursiveDo where foo = do rec str <- return "foo" putStrLn str }}} {{{ $ ghc -c NoRecursiveDo.hs NoRecursiveDo1.hs:4:5: Parse error in pattern: rec Possibly caused by a missing 'do'? }}} {{{ module NoRecursiveDo2 where bar = mdo str <- return "bar" putStrLn str }}} {{{ $ ghc -c NoRecursiveDo2.hs NoRecursiveDo2.hs:4:9: parse error on input `<-' }}} {{{ module NoRecursiveDo3 where baz = mdo putStrLn "baz" }}} {{{ $ ghc -c NoRecursiveDo3.hs NoRecursiveDo3.hs:3:7: Not in scope: `mdo' Perhaps you meant `mod' (imported from Prelude) }}} I think that GHC should suggest to use RecursiveDo extention when using mdo/rec keyword. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8501#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8501: Improve error message when using rec/mdo keyword without RecursiveDo extention. -------------------------------------+------------------------------------- Reporter: shelarcy | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 (Parser) | Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #3968 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by nomeata): * keywords: => newcomer -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8501#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8501: Improve error message when using rec/mdo keyword without RecursiveDo extention. -------------------------------------+------------------------------------- Reporter: shelarcy | Owner: ruperthorlick Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 (Parser) | Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #3968 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by ruperthorlick): * owner: (none) => ruperthorlick * version: 7.6.3 => 8.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8501#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8501: Improve error message when using rec/mdo keyword without RecursiveDo extention. -------------------------------------+------------------------------------- Reporter: shelarcy | Owner: ruperthorlick Type: feature request | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 8.1 (Parser) | Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | parser/should_fail/T8501a Blocked By: | Blocking: Related Tickets: #3968 | Differential Rev(s): Phab:D3271 Wiki Page: | -------------------------------------+------------------------------------- Changes (by ruperthorlick): * status: new => patch * testcase: => parser/should_fail/T8501a * differential: => Phab:D3271 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8501#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8501: Improve error message when using rec/mdo keyword without RecursiveDo
extention.
-------------------------------------+-------------------------------------
Reporter: shelarcy | Owner: ruperthorlick
Type: feature request | Status: patch
Priority: normal | Milestone:
Component: Compiler | Version: 8.1
(Parser) |
Resolution: | Keywords: newcomer
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
| parser/should_fail/T8501a
Blocked By: | Blocking:
Related Tickets: #3968 | Differential Rev(s): Phab:D3271
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#8501: Improve error message when using rec/mdo keyword without RecursiveDo extention. -------------------------------------+------------------------------------- Reporter: shelarcy | Owner: ruperthorlick Type: feature request | Status: closed Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.1 (Parser) | Resolution: fixed | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | parser/should_fail/T8501a Blocked By: | Blocking: Related Tickets: #3968 | Differential Rev(s): Phab:D3271 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed * milestone: => 8.4.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8501#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC