Creating a invalid declaration in TH
"Sean Leather" <[email protected]> Tue, 14 Oct 2008 16:54:50 +0200
| Newsgroups | gmane.comp.lang.haskell.template |
|---|---|
| Message-ID | <[email protected]> |
--===============0918581082== Content-Type: multipart/alternative; boundary="----=_Part_53615_1224179.1223996090336" ------=_Part_53615_1224179.1223996090336 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Apparently, I can create a function declaration (FunD) with a string containing an invalid sequence of characters. It passes typechecking and compiles. It even shows up in GHCi! The function name is "ep:#:", and the :#: is derived from an infix type constructor. In GHCi (6.8.3), I type "ep", hit <Tab> to get the list of completions, and, sure enough, there it is! When I try to use it, GHCi interprets it as two distinct symbols as it should. Template Haskell's claim to fame is that it allows you to do "type-safe compile-time meta-programming," and while this issue is perhaps considered lexical rather than type-level, I'm wondering if there should be some additional error checking (somewhere) to account for this. I admit, I wouldn't know how to do this given the TH API, since Name is used for functions, infix operators, and everything else. Regards, Sean ------=_Part_53615_1224179.1223996090336 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline <div dir="ltr">Apparently, I can create a function declaration (FunD) with a string containing an invalid sequence of characters. It passes typechecking and compiles. It even shows up in GHCi!<br><br>The function name is "ep:#:", and the :#: is derived from an infix type constructor. In GHCi (6.8.3), I type "ep", hit <Tab> to get the list of completions, and, sure enough, there it is! When I try to use it, GHCi interprets it as two distinct symbols as it should.<br> <br>Template Haskell's claim to fame is that it allows you to do "type-safe compile-time meta-programming," and while this issue is perhaps considered lexical rather than type-level, I'm wondering if there should be some additional error checking (somewhere) to account for this. I admit, I wouldn't know how to do this given the TH API, since Name is used for functions, infix operators, and everything else.<br> <br>Regards,<br>Sean<br></div> ------=_Part_53615_1224179.1223996090336-- --===============0918581082== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ template-haskell mailing list [email protected] http://www.haskell.org/mailman/listinfo/template-haskell --===============0918581082==--