
I've tried building ghc with make all; make install But when compiling one of my programs I get GHC stage restriction: `view' is used in a top-level splice, and must be imported, not defined locally What did I do wrong? Marc

On Mon, Apr 17, 2006 at 01:20:34PM +0200, Marc Weber wrote:
GHC stage restriction: `view' is used in a top-level splice, and must be imported, not defined locally
The solution was to change where elemFromList = listToMaybe $ drop 1 $(dropWhile (/= view) $ (xs++[x])) into : where elemFromList = listToMaybe $ drop 1 $ (dropWhile (/= view) $ (xs++[x])) ^ Really missleading error message ;) Marc

Currently -fglasgow-exts implies -fth That is, you get Template Haskell if you specify -fglasgow-exts. The trouble is that if you don't know about TH, then the error messages can be deeply strange, as Marc found. Suggestion: if you want TH, you must specify -fth explicitly; -fglasgow-exts won't imply it. That way any messages about staging will only happen if you've explicitly asked for TH. Any objections? Simon | -----Original Message----- | From: glasgow-haskell-users-bounces@haskell.org [mailto:glasgow-haskell-users- | bounces@haskell.org] On Behalf Of Marc Weber | Sent: 18 April 2006 19:22 | To: glasgow-haskell-users@haskell.org | Subject: Re: Building ghc stages - solved | | On Mon, Apr 17, 2006 at 01:20:34PM +0200, Marc Weber wrote: | > GHC stage restriction: `view' | > is used in a top-level splice, and must be imported, not | > defined locally | | The solution was to change | where elemFromList = listToMaybe $ drop 1 $(dropWhile (/= view) $ (xs++[x])) | into : | where elemFromList = listToMaybe $ drop 1 $ (dropWhile (/= view) $ (xs++[x])) | ^ | | Really missleading error message ;) | | Marc | _______________________________________________ | Glasgow-haskell-users mailing list | Glasgow-haskell-users@haskell.org | http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Hello Simon, Friday, April 21, 2006, 1:35:20 AM, you wrote:
Suggestion: if you want TH, you must specify -fth explicitly; -fglasgow-exts won't imply it.
i agree - glasgow exts are used all the day, TH usage is very rare in my programs -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

On Thu, Apr 20, 2006 at 10:35:20PM +0100, Simon Peyton-Jones wrote:
Currently -fglasgow-exts implies -fth
That is, you get Template Haskell if you specify -fglasgow-exts. The trouble is that if you don't know about TH, then the error messages can be deeply strange, as Marc found.
Thanks for this information. I didn't knew that. I've already read about thl but hadn't enough time to try it. The main problem was that I did compile ghc myself thus thinking I've messed something up.. ;) Marc
participants (3)
-
Bulat Ziganshin
-
Marc Weber
-
Simon Peyton-Jones