|
RE: TH bug: Lift (a -> b) where: msg#00002lang.haskell.glasgow.bugs
This isn't a bug, in fact. TH certainly lets you write programs that, when GHC runs them for you, will loop, and this is one of them. When you write instance Lift (a -> b) where lift f = [| f |] that is shorthand for instance Lift (a->b) where lift f = lift f and that gives the infinite loop. Simon | -----Original Message----- | From: glasgow-haskell-bugs-bounces@xxxxxxxxxxx [mailto:glasgow-haskell-bugs- | bounces@xxxxxxxxxxx] On Behalf Of Saswat Anand | Sent: 19 May 2004 21:05 | To: glasgow-haskell-bugs@xxxxxxxxxxx | Subject: TH bug: Lift (a -> b) where | | Hello, | | I dont know if it has been reported, this looks like a bug in TH. The | program goes into infinite loop. | | Saswat | | ----------------------------- | instance Lift (a -> b) where | lift f = [| f |] | | compile :: (a -> b) -> ExpQ | compile p = lift p | | printE :: ExpQ -> IO () | printE expQ = do exp <- unQ expQ | putStrLn (show exp) | | inc x = x + 1 | | main = printE (compile inc) | ----------------------------- | | | _______________________________________________ | Glasgow-haskell-bugs mailing list | Glasgow-haskell-bugs@xxxxxxxxxxx | http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: bug in instance Read Int, Simon Peyton-Jones |
|---|---|
| Next by Date: | [ ghc-Bugs-960029 ] Segmentation fault with Template Haskell, SourceForge.net |
| Previous by Thread: | RE: bug in instance Read Int, Simon Marlow |
| Next by Thread: | [ ghc-Bugs-960029 ] Segmentation fault with Template Haskell, SourceForge.net |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |