[Haskell-cafe] [Haddock] Alphabetize record accessors

Sumit Sahrawat, Maths & Computing, IIT (BHU) sumit.sahrawat.apm13 at iitbhu.ac.in
Mon Jun 8 03:33:13 UTC 2015


I've seen many cases where a type is specified using a record, but it is
not used for simple cases. For example,

data X = X { a :: String, b :: String }

let t = X "abc" "def"

Thus the ordering of record elements is crucial and should match the one
shown in the haddocks.
It might be possible for haddock to have a button that sorts them, on
demand. That'd be the best of both worlds.

On 8 June 2015 at 08:58, Ivan Lazar Miljenovic <ivan.miljenovic at gmail.com>
wrote:

> On 8 June 2015 at 13:23, aditya siram <aditya.siram at gmail.com> wrote:
> > How would people feel about Haddock alphabetizing record accessors by
> > default?
> >
> > For example:
> >     data T { b :: ..., c :: ... , a :: ... }
> > displays as:
> >     data T { a :: ..., b :: ... , c :: ... }
> >
> > Seems as though projects that have large records like Cabal & Parsec
> would
> > benefit from this.
>
> In some (many?) cases, there is a logical ordering to the values.
> Considering my own code, the records in GraphvizParams here matches
> the ordering that they're used/found in the resultant Dot graph:
>
> http://hackage.haskell.org/package/graphviz-2999.17.0.2/docs/Data-GraphViz.html#t:GraphvizParams
>
> >
> > Thanks!
> > -deech
> >
> > _______________________________________________
> > Haskell-Cafe mailing list
> > Haskell-Cafe at haskell.org
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> >
>
>
>
> --
> Ivan Lazar Miljenovic
> Ivan.Miljenovic at gmail.com
> http://IvanMiljenovic.wordpress.com
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>



-- 
Regards

Sumit Sahrawat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150608/2c5974aa/attachment.html>


More information about the Haskell-Cafe mailing list