Unwanted eta-expansion

2011-10-03 Thread Roman Cheplyaka
Suppose I want a foldl which is evaluated many times on the same list but with different folding functions. I would write something like this, to perform pattern-matching on the list only once: module F where myFoldl :: [a] -> (b -> a -> b) -> b -> b myFoldl [] = \f a -> a myFoldl

RE: mkTopLevEnv: not interpreted main:Main

2011-10-03 Thread Chris Smith
Thanks, Simon. I will work on building a smaller complete test case that reproduces the issue, and I could have done a better job of at least pointing out the relevant code for you. Sorry about that. I'm definitely not building my own IIModule. The use of the GHC API is as follows. (I'm fairly

RE: mkTopLevEnv: not interpreted main:Main

2011-10-03 Thread Simon Peyton-Jones
I don't have a good answer here. FWIW * I believe that the only call to mkTopLevEnv is in InteractiveEval.findGlobalRdrEnv, which in turn only calls mkTopLev on imports which are specified by an IIModule specification (see HscTypes.InteractiveImport). * I think that IIModule things should