All true! Good suggestions. Are you getting on all right with TH now. The mailing list has been rather quiet recently. Simon | -----Original Message----- | From: glasgow-haskell-bugs-bounces@haskell.org [mailto:glasgow-haskell-bugs- | bounces@haskell.org] On Behalf Of Gregory Wright | Sent: 29 January 2004 22:04 | To: glasgow-haskell-bugs@haskell.org | Subject: Documentation fix for TH example | | | Hi, | | The GHC 6.2 User's Guide has some misleading information w.r.t. | template haskell. | | It still uses Expr instead of ExpQ. It refers to Tim Sheard's notes, | but doesn't have the link | | http://research.microsoft.com/~simonpj/tmp/notes2.ps | | It should also warn that not all of the features discussed in the above | notes are implemented. | In particular, the way to get TH is still to import | Language.Haskell.THSyntax, not Language.Haskell.TH. | | The example doesn't compile under 6.2. The attachment corrects this. | | A note that TH is rapidly evolving and that the API is likely to change | incompatibly between | compiler releases might not be out of place either. (I know that such | warnings are present | in the literature and in some places on the mailing list, but language | users who are not | part of the FP community look to the documentation first.) | | Best Wishes, | | Greg | | Gregory Wright | Antiope Associate LLC | 18 Clay Street | Fair Haven, New Jersey 07704 | | gwright@antiope.com |
On Feb 3, 2004, at 10:58 AM, Simon Peyton-Jones wrote:
All true! Good suggestions.
Are you getting on all right with TH now. The mailing list has been rather quiet recently.
Simon
Hi Simon, I'm starting to understand TH and I've been able to make all the examples people have given me compile on 6.2. This is good progress. My recent interest in TH began with a question I posted to the haskell-cafe list, asking what was the best way to handle fields in a buffer. (I spend a lot of time looking at IP packets.) Mikael Brockman suggested looking at Erlang's bit syntax. Tomasz Zielonka posted his code which uses TH to generate the boilerplate for handling byte fields in arrays. I'm starting from Tomasz's code but will add bit fields. I'll also have to add handling for mutable arrays. Tomasz's code uses parsec, which I'd never bothered to learn parsec so I spent part of the weekend doing the examples in the user guide. Tomasz's deserialization package is a good starting point, and I hope to have something soon. On the other hand, we have a six week old daughter, and while she is quite 'functional' (unique outputs for every input), she still has trouble with emacs. Perhaps we should have started her with vi. It appears as if people are happy to answer TH questions on the ghc-* or haskell-cafe lists. Perhaps inquiries could be directed there and the TH list used for announcements? Best Wishes, Greg
| -----Original Message----- | From: glasgow-haskell-bugs-bounces@haskell.org [mailto:glasgow-haskell-bugs- | bounces@haskell.org] On Behalf Of Gregory Wright | Sent: 29 January 2004 22:04 | To: glasgow-haskell-bugs@haskell.org | Subject: Documentation fix for TH example | | | Hi, | | The GHC 6.2 User's Guide has some misleading information w.r.t. | template haskell. | | It still uses Expr instead of ExpQ. It refers to Tim Sheard's notes, | but doesn't have the link | | http://research.microsoft.com/~simonpj/tmp/notes2.ps | | It should also warn that not all of the features discussed in the above | notes are implemented. | In particular, the way to get TH is still to import | Language.Haskell.THSyntax, not Language.Haskell.TH. | | The example doesn't compile under 6.2. The attachment corrects this. | | A note that TH is rapidly evolving and that the API is likely to change | incompatibly between | compiler releases might not be out of place either. (I know that such | warnings are present | in the literature and in some places on the mailing list, but language | users who are not | part of the FP community look to the documentation first.) | | Best Wishes, | | Greg | | Gregory Wright | Antiope Associate LLC | 18 Clay Street | Fair Haven, New Jersey 07704 | | gwright@antiope.com |
_______________________________________________ template-haskell mailing list template-haskell@haskell.org http://www.haskell.org/mailman/listinfo/template-haskell
Hi! On Tue, Feb 03, 2004 at 01:19:16PM -0500, Gregory Wright wrote:
I'm starting from Tomasz's code but will add bit fields. I'll also have to add handling for mutable arrays.
Tomasz's code uses parsec, which I'd never bothered to learn parsec so I spent part of the weekend doing the examples in the user guide.
If I remember correctly, you were dealing with unboxed arrays. In my package there are two low-lever BinaryParsers - one that uses Parsec, and one that parses from (UArray Int Word8)s. They are independent from each other, so you can ignore the former. BTW, Parsec is a really good and useful library, something you should learn anyway.
Tomasz's deserialization package is a good starting point, and I hope to have something soon.
When that happens, I would love to see the results. Unfortunatelly I don't have the time and energy to work on this library now. I'll try to find time to extract and release the encoding part of my little framework. Best regards, Tom -- .signature: Too many levels of symbolic links
Hi Tom, On Feb 3, 2004, at 1:40 PM, Tomasz Zielonka wrote:
Hi!
On Tue, Feb 03, 2004 at 01:19:16PM -0500, Gregory Wright wrote:
I'm starting from Tomasz's code but will add bit fields. I'll also have to add handling for mutable arrays.
Tomasz's code uses parsec, which I'd never bothered to learn parsec so I spent part of the weekend doing the examples in the user guide.
If I remember correctly, you were dealing with unboxed arrays. In my package there are two low-lever BinaryParsers - one that uses Parsec, and one that parses from (UArray Int Word8)s. They are independent from each other, so you can ignore the former.
Yes, my immediate application is for unboxed arrays, but if I'm going to learn the TH infrastructure, I might as well try to build a library that can be extended to support different kinds of arrays.
BTW, Parsec is a really good and useful library, something you should learn anyway.
I once wrote a compiler for a little language that controlled some network hardware, so I have a soft spot for parsing ;-)
Tomasz's deserialization package is a good starting point, and I hope to have something soon.
When that happens, I would love to see the results. Unfortunatelly I don't have the time and energy to work on this library now. I'll try to find time to extract and release the encoding part of my little framework.
BTW, I have a patch that will build DecodeTH.hs under 6.2, using the new TH syntax. It's quite simple and no doubt you could do it yourself in a few minutes, but I can send it to you if you'd like.
Best regards, Tom
--
Best Wishes, Greg
participants (3)
-
Gregory Wright -
Simon Peyton-Jones -
Tomasz Zielonka