Plugins: How to determine ghc vs ghci

2015-11-23 Thread Levent Erkok
I'm working on a plugin, and would like to be able to tell if it's GHC or GHCi that's running. I tried: df <- getDynFlags let isGHCi = ghcMode df == CompManager Alas, while that correctly tells apart "ghci" from "ghc -c", it also returns True when ghc is called without the "-c" argument.

Re: Remote GHCi

2015-11-23 Thread Manuel M T Chakravarty
Hi Simon, Sounds great! This may very well what you have got in mind anyway, but I could imagine to run the interpreter on a different thread in the -fno-external-interpreter case and arrange communication through the same messaging API that you outlined for the seperate-process interpreter.

Re: Should (~) be homogeneous or heterogeneous?

2015-11-23 Thread Dan Doel
I suspect he means that with `t1 :: k1` and `t2 :: k2`, `t1 ~ t2` is permitted as long as `k1 ~ k2` accompanies it. However, this would already work with homogeneous ~, wouldn't it (because homogeneity is up to whatever constraints are in scope)? On Mon, Nov 23, 2015 at 11:05 AM, Richard Eisenber

RE: [GHC] #11019: ApiAnnotations: Make all RdrName occurences Located

2015-11-23 Thread Simon Peyton Jones
The commit is a one-line change to IEThingAll, which says: -- See Note [Located RdrNames] in HsExpr But HsExpr does not contain such a Note. Did you omit something? Simon From: Alan & Kim Zimmerman [mailto:alan.z...@gmail.com] Sent: 23 November 2015 13:40 To: Simon Peyton Jones Subject

Re: Remote GHCi

2015-11-23 Thread Simon Marlow
Hi Manuel, Thanks for the detailed reply, I have a much better understanding of your requirements now. I'm going to support both models of running interpreted code. The current plan is to have a flag, -fexternal-interpreter, which GHC will use by default when running Template Haskell during

Re: Should (~) be homogeneous or heterogeneous?

2015-11-23 Thread Richard Eisenberg
> Naive question: > Would it be "evil" or otherwise complicated to assume that (~) is > heterogeneous only in the _presence_ of kind constraint? Or only when > the kind can be inferred? I'm afraid I don't understand. Do you mean that it's heterogeneous only when -XTypeInType is specified? That ju

Re: Should (~) be homogeneous or heterogeneous?

2015-11-23 Thread MichaƂ J . Gajda
Naive question: Would it be "evil" or otherwise complicated to assume that (~) is heterogeneous only in the _presence_ of kind constraint? Or only when the kind can be inferred? -- Cheers Michal On 23/11/2015 03:00, Richard Eisenberg wrote: > > * Should (~), as written in user code, require

RE: [GHC] #11019: ApiAnnotations: Make all RdrName occurences Located

2015-11-23 Thread Simon Peyton Jones
Alan | ApiAnnotations: Make all RdrName occurences Located There is a principle here: that every RdrName occurrence is located. Is this principle articulated in a Note anywhere? I wish it was! (Including an explanation of why.) Otherwise you risk someone removing the change in a few years t