Re: RE: TH2 bug

Ian Lynagh <[email protected]>
Newsgroups gmane.comp.lang.haskell.template
Message-ID <[email protected]>
On Wed, Oct 27, 2004 at 02:19:57PM +0100, Simon Peyton-Jones wrote:
> 
> And what questions do you want to be able to ask of the value in the
> Info?  For example would it be enough to day
> 
>   data Info = TyConI Dec
> 	| PrimTyCon
> 	| ClassI Dec
> 	...etc...
> 
> where the PrimTyCon is returned for (->), Int#, etc?

Being able to tell whether it is a lifted type or not might be useful,
so you know not to go making class instances of Int#. Also it may be
useful to know that (->) takes 2 types as arguments. Maybe

    PrimTyCon Bool{-unlifted-} Name [Name]

(i.e. DataD with all the stuff that doesn't occur removed)? In fact, we
could just have (DataD [] name names [] []), but I think I prefer the
above as it makes it clear you can't tweak it a bit and splice it in
(and gives a place to say "unlifted").


Incidentally, ghci seems to be running the contents of splices twice:

Prelude Language.Haskell.TH> $( do runIO $ putStrLn "Foo"; return (LitE (IntegerL 5)) )
Foo
Foo
5
Prelude Language.Haskell.TH> 


Thanks
Ian
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.