[Haskell-cafe] pretty printing with comments
Pasqualino "Titto" Assini
tittoassini at gmail.com
Tue Oct 20 15:55:56 EDT 2009
Hi,
there is also another difference:
type URL= String
was a top level definition but it has been moved under the previous
instance declaration.
I attach a source fragment and another file with the pretty printed
output containing these three errors.
Regarding the problem of pretty printing while keeping the comments I
imagine that you would like the comments to be associated with the
previous syntactical element (module, top level declaration or
expression) and be rendered in the same relative position in the
pretty printed output.
I agree that it doesn't sound like an easy task.
However, similar systems exists for most languages (I loved my Java
reformatter in Eclipse) and it would be very handy in Haskell as well.
Best,
titto
2009/10/20 Niklas Broberg <niklas.broberg at gmail.com>:
>>>> instance Dir Directory where
>>>> localDir (Local f) = return f
>>>>
>>>> typeURL= String
>>>
>>> Sorry, I don't see the difference between these two. Did you write the
>>> correct one twice by mistake?
>>
>> In case Pasqualino doesn't see your mail real soon...
>> Maybe the difference is the missing space between "type" and "URL".
>
> Ah, of course, I see it now, thanks!
>
> Cheers,
>
> /Niklas
>
--
Pasqualino "Titto" Assini, Ph.D.
http://quicquid.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestPP.hs
Type: text/x-haskell
Size: 876 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20091020/b59bb29b/TestPP.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestPP_PRETTY.hs
Type: text/x-haskell
Size: 873 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20091020/b59bb29b/TestPP_PRETTY.bin
More information about the Haskell-Cafe
mailing list