id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,os,architecture,failure,difficulty,testcase,blockedby,blocking,related
2798,"Enable ""rec"" keyword when RecursiveDo is enabled?",nominolo,igloo,"GHC supports recursive statement groups marked by the keyword {{{rec}}}, however this is only activated via a hack.  Consider this (silly) example program:
{{{
{-# LANGUAGE RecursiveDo, Arrows #-}

main :: IO ()

main =
 mdo x <- return (length [1..42::Int])
     rec b <- return x
         let a = const c
         c <- print ""x""
     return (a b)
}}}
The {{{Arrow}}} language needs to be enabled, otherwise the {{{rec}}} keyword wouldn't be recognised.  Currently this behaviour is undocumented, and {{{rec}}} groups only appear in the internal AST.

This ticket has been created to have a documented decsion whether this feature is supported or not.  Given that GHC automatically identifies strongly-connected components and re-groups things (although it cannot re-order statements due to probable dependencies) having an explicet {{{rec}}} keyword probably isn't that useful.  In particular
{{{
mdo foo   ...is equivalent to...      mdo rec foo
    bar                                       bar
    baz                                   baz
}}}
Thoughts?",task,closed,high,7.0.1,Compiler,6.11,fixed,,,Unknown/Multiple,Unknown/Multiple,None/Unknown,Unknown,,,,
