Re: [Haskell-cafe] Re: haddock could be a pretty-printer?

2009-05-23 Thread David Waern
2009/5/22 Maurício briqueabra...@yahoo.com:
 The new version of haddock makes use of GHC parser. How much
 of effort would take to make haddock generate pretty-print
 of the source code itself, (...)

 (...) Is this what you want or is there some reason why you
 want the code to be pretty-printed?

 I usually have to resort to braces or bad indenting to get
 code to parse, but I like to give it good presentation before
 publishing.

 I used to pretty-print my code using haskell-src-exts with
 great result, but that kills documentation.

I think the plan is to extend haskell-src-exts to retain comments. But
if you want something that works now, you could use the GHC API. It
has support for getting the token stream of a module, which contains
the comments as tokens.

Using Haddock to do this is not a good idea, better use the GHC API directly.

David
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: haddock could be a pretty-printer?

2009-05-22 Thread Maurício
 The new version of haddock makes use of GHC parser. How much
 of effort would take to make haddock generate pretty-print
 of the source code itself, (...)

 (...) Is this what you want or is there some reason why you
 want the code to be pretty-printed?

I usually have to resort to braces or bad indenting to get
code to parse, but I like to give it good presentation before
publishing.

I used to pretty-print my code using haskell-src-exts with
great result, but that kills documentation.

Best,
Maurício

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe