RE: [Template-haskell] Using a Typ as a Type
Tim and I are working on this very thing right now. Stay tuned Simon | -----Original Message----- | From: Alastair Reid [mailto:alastair@reid-consulting-uk.ltd.uk] | Sent: 03 September 2003 16:17 | To: Simon Peyton-Jones; Alastair Reid; template-haskell@haskell.org | Subject: Re: [Template-haskell] Using a Typ as a Type | | On Wednesday 03 September 2003 2:19 pm, Simon Peyton-Jones wrote: | > | > TH doesn't support type splices today; that's one of the things I'm | > | > actively working on. But I'm not sure if this is what you meant. | | btw Something that would be very nice is if $ could be used to splice patterns | and declarations as well as expressions so that I could write: | | foo :: String -> Q [Dec] | foo x = [| \ $(pat x) -> $(var x) |] | | or | | bar :: Q Expr -> Q Dec -> Q [Dec] | bar e binding = [| let $binding in $e |] | | These examples aren't that compelling but I've had to code round not being | able to write code like this lots of times. | | -- | Alastair | | ps This is quite independent of my request for type splices. The above makes | it easier to write what you can already write whereas type splices extend the | power of TH to let you write things that aren't possible at the moment. | |
participants (1)
-
Simon Peyton-Jones