[Template-haskell] RE: Question regarding template Haskell

Simon Peyton-Jones simonpj at microsoft.com
Wed Sep 17 13:07:23 EDT 2003


I missed that message.  How does rType differ from typeOf, defined in
Data.Typeable?

simon

| -----Original Message-----
| From: ozone at algorithm.com.au [mailto:ozone at algorithm.com.au]
| Sent: 17 September 2003 11:04
| To: Simon Peyton-Jones
| Cc: template-haskell at haskell.org; diyu60607 at yahoo.com
| Subject: Re: [Template-haskell] RE: Question regarding template
Haskell
| 
| On 17/09/2003, at 7:45 PM, Simon Peyton-Jones wrote:
| 
| > | Hi, I have a question regarding template Haskell: from
| > | the documentation, I have the impression that it is
| > | impossible to reify the type of the variable passed to
| > | the template function, is this true? Or, in other
| > | words, can I write a function like:
| > |
| > | getTupleCount :: a -> ExpQ
| > |
| > | getTupleCount x=
| > |   do
| > |      t <- (reifyType x)
| > |      --work on t
| > |      ...
| 
| If your 'x' variable is monomorphic, you can use the rType function
| that Sean and I came up with, detailed here:
| 
| 
|
http://www.haskell.org/pipermail/template-haskell/2003-July/000128.html
| 
| That currently handles only 2-tuples, but it shouldn't be too hard to
| extend it to work on any-size tuples.  Let me know if you're having
| problems.
| 
| 
| --
| % Andre Pang : trust.in.love.to.save




More information about the template-haskell mailing list