
#13905: ApplicativeDo is too strict with newtype patterns -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): That is extremely annoying, and so clearly an artefact of GHC's architecture, rather than any solid reason, that we should question it. For example we could 1. Keep track in the renamer of what local data constructors are newtypes. (We already know this for imported ones.) 2. Rename and typecheck all data/class decls before we even start on the value declarations. A bit like we do for top-level Template Haskell splices. The second of these looks more solid to me. I recall that there's a similar issue with record fields, when the renamer wants to know what fields a particular data constructor has. Currently we use a variant of (1) I think; but (2) would solve it and thereby simplify that code. So I quite like (2). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13905#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler