Template Haskell
Simon Peyton-Jones
simonpj at microsoft.com
Fri Apr 14 07:52:06 EDT 2006
Thank you for the bug report. It certainly is a bug. I'm fixing it now. Sadly, I've missed the boat for GHC 6.4.2, but the fix will be in the HEAD, and in the next release.
Simon
| -----Original Message-----
| From: glasgow-haskell-bugs-bounces at haskell.org [mailto:glasgow-haskell-bugs-
| bounces at haskell.org] On Behalf Of mze at informatik.uni-kiel.de
| Sent: 15 March 2006 12:33
| To: glasgow-haskell-bugs at haskell.org
| Subject: Template Haskell
|
| Hi,
|
| i've got a problem with the function recover in Template Haskell:
|
| I'd like to check, if a function is already implemented. My idea is to
| call reify with the functionname. But reify throws an error if the name is
| not in scope. So I wanted to use "recover", but it doesn't work like
| expected:
|
| y = $(recover (return (LitE (IntegerL 1)))
| (reify (mkName ("ola")) >> return (LitE (IntegerL 2))))
|
| The compilation failed: `ola' is not in scope at a reify
| In the definition of `y'
| I thought the value of y would be 1, if "ola" is not in scope and 2
| otherwise.
|
|
| And even this doesn't work (the compilation failed):
|
| x = $(recover (return (LitE (IntegerL 1)))
| (report True "error" >> return (LitE (IntegerL 2))))
|
|
| Is there a bug in recover?
|
| Melanie Bargstädt
|
|
|
|
|
|
|
| _______________________________________________
| Glasgow-haskell-bugs mailing list
| Glasgow-haskell-bugs at haskell.org
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
More information about the Glasgow-haskell-bugs
mailing list