
#8945: GHC produces grouped declarations in a weird order -------------------------------------+------------------------------------ Reporter: Fuuzetsu | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHC API | Version: 7.9 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by haasn): I think the issue might actually be in the parser, more specifically in ghc/compiler/parser/Parser.y.pp: {{{ sig_vars :: { Located [Located RdrName] } : sig_vars ',' var { LL ($3 : unLoc $1) } | var { L1 [$1] } ... sigdecl :: { Located (OrdList (LHsDecl RdrName)) } : ... | var ',' sig_vars '::' sigtypedoc { LL $ toOL [ LL $ SigD (TypeSig ($1 : unLoc $3) $5) ] } }}} sig_vars is returning stuff in the opposite order. Seems to me like sig_vars should be changed to use an OrdList and snoc instead of consing. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8945#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler