[Haddock] Alphabetize record accessors

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. Thanks! -deech

On 8 June 2015 at 13:23, aditya siram
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.h...
Thanks! -deech
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
-- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com http://IvanMiljenovic.wordpress.com

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
On 8 June 2015 at 13:23, aditya siram
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.h...
Thanks! -deech
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
-- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com http://IvanMiljenovic.wordpress.com _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
-- Regards Sumit Sahrawat

On Sun, Jun 7, 2015 at 11:23 PM, aditya siram
How would people feel about Haddock alphabetizing record accessors by default?
It occurs to me that the Haskell Report specifies that Read instances for record types accept the fields only in declaration order[1], and it might therefore be preferable to maintain that order in API documentation. [1] https://www.haskell.org/onlinereport/haskell2010/haskellch11.html#x18-186000... see point 3 under "Derived instances of Read' -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

On 06/09/2015 01:26 PM, Johannes Waldmann wrote:
Read instances for record types accept the fields only in declaration order[1],
order is also important for semantics of deriving Ord, and for cost (or strictness) of deriving Eq. So, re-ordering would be confusing.
- J.W.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
I agree. – Haddock maintainer -- Mateusz K.
participants (6)
-
aditya siram
-
Brandon Allbery
-
Ivan Lazar Miljenovic
-
Johannes Waldmann
-
Mateusz Kowalczyk
-
Sumit Sahrawat, Maths & Computing, IIT (BHU)