[Haskell-cafe] Prettier pretty-printing of data types?
Austin Seipp
mad.one at gmail.com
Tue Mar 13 23:37:24 CET 2012
It's not exactly hierarchical, but Groom most certainly should help
with getting much prettier output:
http://hackage.haskell.org/package/groom
On Tue, Mar 13, 2012 at 5:33 PM, Johan Tibell <johan.tibell at gmail.com> wrote:
> Hi all,
>
> The derived Show instance is useful, but I sometimes wish for
> something that's easier to read for big data types. Does anyone have
> an implementation of show that draws things in a hierarchical manner?
> Example:
>
> Given
>
> data Tree a = Leaf | Bin Int a (Tree a) (Tree a)
>
> and
>
> value = Bin 1 (Bin 2 Leaf Leaf) (Bin 3 Leaf Leaf)
>
> draw as
>
> Bin
> 1
> Bin
> 2
> Leaf
> Leaf
> Bin
> 3
> Leaf
> Leaf
>
> Cheers,
> Johan
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
--
Regards,
Austin
More information about the Haskell-Cafe
mailing list