Skip to content

DoRec not supported, but RecursiveDo deprecated

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'
Trac metadata
Trac field Value
Version 6.12.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information