
On 30/01/13 01:20, Ian Lynagh wrote:
On Fri, Jan 18, 2013 at 05:03:26PM +0000, Simon Marlow wrote:
On 18/01/13 16:45, Simon Peyton-Jones wrote:
| > In Packages we have a dflags with an error thunk in it for pkgState, | and it's the strict evaluation of that pkgState that is changing the | behaviour. | | Whereabouts are we evaluating it? Could we fix that instead?
That would be good. It's here;
applyPackageFlag dflags unusable pkgs flag = case flag of ExposePackage str -> case selectPackages (matchingStr str) pkgs unusable of Left ps -> packageFlagErr dflags flag ps Right (p:ps,qs) -> return (p':ps') where p' = p {exposed=True} ps' = hideAll (pkgName (sourcePackageId p)) (ps++qs) _ -> panic "applyPackageFlag"
etc
The call to packageFlagErr is divergent, of course, but dflags has an error thunk for the pkgState.
Looks like we should be using throwIO. Unfortunately I'm out of time right now, feel free to fix it, otherwise I'll do it next week.
I tried that, but it didn't fix it.
Me too :)
However, it seems like a sensible thing to be doing anyway, so I pushed the patch. I'll do a sweep for other places that we could/should be using throwIO.
Yes, we should definitely be using throwIO. In fact, every use of throwGhcException should be treated with suspicion. Cheers, Simon