[Haskell-cafe] Pretty Print, text or ++?

John Van Enk vanenkj at gmail.com
Fri Aug 15 09:58:59 EDT 2008


Paul,

I'm sorry, I ignored the "PrettyPrint" part and latched onto the "faster"
part. You definitely don't want concat. I was looking at run-time. :)

/jve

On Fri, Aug 15, 2008 at 9:35 AM, Paul Keir <pkeir at dcs.gla.ac.uk> wrote:

>  Thanks,
>
> So you're recommending:
>
> text (concat [a,b,c,d,e])
>
> Might this not transform my pretty printing into ugly printing; when longer
> strings are used?
>
> Paul
>
>
>
> -----Original Message-----
> From: sw17ch at gmail.com on behalf of John Van Enk
> Sent: Fri 15/08/2008 14:31
> To: Paul Keir
> Cc: haskell-cafe at haskell.org
> Subject: Re: [Haskell-cafe] Pretty Print, text or ++?
>
> Paul,
>
> Something tells me you might want to look at `concat':
>
> concat :: [[a]] -> [a]
>
> /jve
>
>
> 2008/8/15 Paul Keir <pkeir at dcs.gla.ac.uk>
>
> >  Hi there,
> >
> > I'm writing a pretty printer using the Text.PrettyPrint library, and
> > there's a pattern I'm coming across quite often. Does anyone know
> whether,
> >
> > text (a ++ b ++ c ++ d)
> > or
> > text a <+> text b <+> text c <+> text d
> >
> > runs quicker?
> >
> > Cheers,
> > Paul
> >
> > _______________________________________________
> > Haskell-Cafe mailing list
> > Haskell-Cafe at haskell.org
> > http://www.haskell.org/mailman/listinfo/haskell-cafe
> >
> >
>
>
> --
> /jve
>
>


-- 
/jve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080815/510a0fad/attachment.htm


More information about the Haskell-Cafe mailing list