RE: Question about correct GHC-API use for type checking (or zonking, or tidying)

2013-09-11 Thread p.k.f.holzenspies
Well, my tcLocalBinds seems to have a different type then yours (this is from my copy of 7.6.3 and it's the same in the HEAD that I just synced): tcLocalBinds :: HsLocalBinds Name - TcM thing - TcM (HsLocalBinds TcId, thing) If I want to get a GblEnv out, I can use getGblEnv, but doing this:

RE: Question about correct GHC-API use for type checking (or zonking, or tidying)

2013-09-04 Thread Simon Peyton-Jones
The id you are getting is a monomorphic id, with a type like a-a, not the polymorphic forall a. a-a. You don't want to go round arbitrarily creating a new Id with the same unique but a different type. I have no idea what would happen then. It's hard for me to understand just what you code is

RE: Question about correct GHC-API use for type checking (or zonking, or tidying)

2013-09-02 Thread Simon Peyton-Jones
Does this mean that for the idType to come out correctly I should also zonk (AND BIND) the Id-value I return? Yes, zonk the type and grab the type that comes back. S From: p.k.f.holzensp...@utwente.nl [mailto:p.k.f.holzensp...@utwente.nl] Sent: 30 August 2013 17:49 To: Simon Peyton-Jones;

Re: Question about correct GHC-API use for type checking (or zonking, or tidying)

2013-08-30 Thread p.k.f.holzenspies
I feel so unbelievably ignorant now. I thought with all the IORefs in the type checking process that zonking did this in these refs. Somehow I started thinking that some of these remained in SDocs, not thinking showSDoc is pure and results in a String, which holds no IORefs. Does this mean

RE: Question about correct GHC-API use for type checking (or zonking, or tidying)

2013-08-30 Thread Simon Peyton-Jones
Haskell is a *functional* language. Consider say $ pre-zonk: ++ pp all_expr_ty zonkTcType all_expr_ty say $ post-zonk: ++ pp all_expr_ty pp is a pure function; it is given the same input both times, so of course it produces the same output. If you collect the result of

Question about correct GHC-API use for type checking (or zonking, or tidying)

2013-08-29 Thread p.k.f.holzenspies
Dear GHC-ers, I'm working on building an interactive environment around the composition of expressions. Users can type in (i.e. give strings of) expressions and can then use these expressions to produce other expressions. I'm close to having a working GHC-API binding for this. The resulting