[Haskell-cafe] GHC wish

Christophe Poucet christophe.poucet at gmail.com
Tue May 23 22:21:39 EDT 2006


Hello Chris,

It seems that your reply only replied to me and not to the haskell-cafe 
list.  I hope you do not mind that I reply to the list.  Anyways, 
regarding how the AST is pretty printed.  I was not thinking of any 
highlevel pretty printing of an AST (at least not derived 
automatically).  The type of pretty printing I was thinking of would be 
synonymous to what deriving Show would give you for any type, except 
that it would be layed out a bit more cleanly with indentation and newlines.
Here is an example:

data Foo = Foo {unFoo :: [Bar]}
data Bar = Bar {unBar :: Int}

prettyPrint . Foo. map Bar $ [1..10]
Foo {
  unFoo = [
    Bar {unBar = 1},
    Bar {unBar = 2},
    ..
    Bar {unBar =10}
    ]
}

Jared:  Thank you for mentioning DrIFT.  Will certainly take a look at it :)

Cheers,
Christophe

Christopher Brown wrote:

> Christophe,
>
> But that depends on what you think is the correct way of displaying  
> an AST. I can personally think of a few ways an AST could be pretty  
> printed.
>
> Chris.
>
>
> On 24 May 2006, at 00:05, Christophe Poucet wrote:
>
>> Dear all,
>>
>> I recently stumbled upon something that I think should be added to  
>> the GHC wishlist. Not knowing where to put it, I will put it here.  
>> As there is deriving(Show) for most basic data types, wouldn't it  be 
>> possible to have something similar but then deriving(Pretty).  When 
>> printing ASTs it could make it much easier to look at the output.
>>
>> With regards,
>> Christophe
>>
>> -- 
>> Christophe Poucet
>> Ph.D. Student
>> Phone:+32 16 28 87 20
>> E-mail: Christophe (dot) Poucet (at) imec (dot) be
>> Website: http://notvincenz.com/  IMEC vzw – Register of Legal  
>> Entities Leuven VAT BE 0425.260.668 – Kapeldreef 75, B-3001 Leuven,  
>> Belgium – www.imec.be
>> *****DISCLAIMER*****
>> This e-mail and/or its attachments may contain confidential  
>> information. It is intended solely for the intended addressee(s).
>> Any use of the information contained herein by other persons is  
>> prohibited. IMEC vzw does not accept any liability for the contents  
>> of this e-mail and/or its attachments.
>> **********
>>
>> _______________________________________________
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
>


-- 
Christophe Poucet
Ph.D. Student
Phone:+32 16 28 87 20
E-mail: Christophe (dot) Poucet (at) imec (dot) be
Website: http://notvincenz.com/  
IMEC vzw – Register of Legal Entities Leuven VAT BE 0425.260.668 – Kapeldreef 75, B-3001 Leuven, Belgium – www.imec.be
*****DISCLAIMER*****
This e-mail and/or its attachments may contain confidential information. It is intended solely for the intended addressee(s).
Any use of the information contained herein by other persons is prohibited. IMEC vzw does not accept any liability for the contents of this e-mail and/or its attachments.
**********



More information about the Haskell-Cafe mailing list