RE: [Haskell-cafe] Template Haskell, information about data constructor types

2007-06-21 Thread Simon Peyton-Jones
ease update the Wiki with whatever you have learned! Simon | -Original Message- | From: [EMAIL PROTECTED] [mailto:haskell-cafe- | [EMAIL PROTECTED] On Behalf Of Neil Mitchell | Sent: 04 June 2007 10:46 | To: Simon Peyton-Jones | Cc: Haskell Café | Subject: Re: [Haskell-cafe] Template H

Re: [Haskell-cafe] Template Haskell, information about data constructor types

2007-06-05 Thread Ian Lynagh
On Mon, Jun 04, 2007 at 10:45:30AM +0100, Neil Mitchell wrote: > > On 6/4/07, Simon Peyton-Jones <[EMAIL PROTECTED]> wrote: > > > Perhaps you mean that reify doesn't work on type constructors? (E.g. > > reify ''Maybe). > >It should -- if you think it doesn't can you concoct a test case and > >

Re: [Haskell-cafe] Template Haskell, information about data constructor types

2007-06-04 Thread Neil Mitchell
Hi Simon, On 6/4/07, Simon Peyton-Jones <[EMAIL PROTECTED]> wrote: | Where typeApp splits a type to find its constructor, ctorTypes gets | the types of the fields, and dataCtors gets the constructors in a data | type. Unfortunately reify doesn't seem to work on types. Is it | possible to do what

RE: [Haskell-cafe] Template Haskell, information about data constructor types

2007-06-04 Thread Simon Peyton-Jones
| Where typeApp splits a type to find its constructor, ctorTypes gets | the types of the fields, and dataCtors gets the constructors in a data | type. Unfortunately reify doesn't seem to work on types. Is it | possible to do what I am after? reify takes a Name, not a Type. Perhaps you mean that r

[Haskell-cafe] Template Haskell, information about data constructor types

2007-06-03 Thread Neil Mitchell
Hi I'm trying to write a function: reaches :: Type -> Q [Type] The intention is that reaches (Either Bool [Int]) would return [Either Bool [Int], Bool, [Int], Int] - i.e. all types which are contained by the initial type at any level. I took a shot at this: getTypes :: Type -> Q [Type] getTyp