Ticket #3968 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

DoRec not supported, but RecursiveDo deprecated

Reported by: m4dc4p Owned by: igloo
Priority: normal Milestone: 6.12.3
Component: Compiler Version: 6.12.1
Keywords: Cc:
Operating System: Windows Architecture: x86
Type of failure: GHC rejects valid program Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

GHC 6.12.1 reports that the RecursiveDo pragma has been deprecated in favor of DoRec. However, DoRec has two problems:

  • Not supported by GHC
  • Not defined in Cabal's Language.Haskell.Extension.Extension data type.

When compiling with -XRecursiveDo, a warning is issued.

When compiling with -XDoRec, the mdo syntax is not recognized. You get "Not in scope: mdo'" or "parse error on input <-'".

It doesn't seem to matter if the commmand line flag or LANGUAGE pragma is used.

The following shows the results of compiling the attached file with the two flags:

>ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.12.1

>ghc -c -fforce-recomp -XRecursiveDo DoRec.hs

on the commandline:
    Warning: -XRecursiveDo is deprecated: use -XDoRec or pragma {-# LANGUAGE DoRec #-} instead

>ghc -c -fforce-recomp -XDoRec DoRec.hs

DoRec.hs:5:8: Not in scope: `mdo'

Attachments

DoRec.hs Download (58 bytes) - added by m4dc4p 3 years ago.
Example file with mdo notation

Change History

Changed 3 years ago by m4dc4p

Example file with mdo notation

Changed 3 years ago by malcolm.wallace@…

The reason RecursiveDo? has been deprecated is because the syntax has changed. With the new alternative, DoRec?, the 'mdo' keyword has been removed in favour of a new keyword 'rec'. See  http://haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#mdo-notation

However, I note that the GHC User Guide still lists the old name for the language extension (at  http://haskell.org/ghc/docs/latest/html/users_guide/flag-reference.html), and does not list the new name.

Changed 3 years ago by simonpj

  • owner set to igloo

See #2798.

Thanks for pointing out the bogus documentation in the flag reference. Ian, could you fix this please (10 mins).

Simon

Changed 3 years ago by igloo

  • type changed from bug to merge
  • milestone set to 6.12.3
Fri Apr 16 13:54:16 PDT 2010  Ian Lynagh <igloo@earth.li>
  * Update the user guide so it talks about the newer "do rec" notation

Changed 3 years ago by igloo

  • status changed from new to merge
  • type changed from merge to bug

Changed 3 years ago by igloo

  • status changed from merge to closed
  • resolution set to fixed
  • patch set to 0

Merged

Note: See TracTickets for help on using tickets.