Haddock, wrapping contexts?

Some of my type signatures have long contexts and Haddock doesn't wrap them, pushing the more interesting information off the right hand side, e.g.: https://hackage.haskell.org/package/opaleye-0.5.1.1/docs/Opaleye-Join.html Is there any way I can convince Haddock to wrap these contexts? Ideally I want to see something like leftJoin :: (Default Unpackspec columnsA columnsA, Default Unpackspec columnsB columnsB, Default NullMaker columnsB nullableColumnsB) => Query columnsA -> Query columnsB -> ((columnsA, columnsB) -> Column PGBool) -> Query (columnsA, nullableColumnsB) Thanks, Tom

I see `leftJoin` signature wrapped, but not `leftJoinExplicit` for example. I suppose if you will document arguments Haddock will wrap that signatures too. [image: Снимок экрана 2016-10-28 в 13.53.25.png] пт, 28 окт. 2016 г. в 13:39, Tom Ellis < tom-lists-haskell-cafe-2013@jaguarpaw.co.uk>:
Some of my type signatures have long contexts and Haddock doesn't wrap them, pushing the more interesting information off the right hand side, e.g.:
https://hackage.haskell.org/package/opaleye-0.5.1.1/docs/Opaleye-Join.html
Is there any way I can convince Haddock to wrap these contexts? Ideally I want to see something like
leftJoin :: (Default Unpackspec columnsA columnsA, Default Unpackspec columnsB columnsB, Default NullMaker columnsB nullableColumnsB) => Query columnsA -> Query columnsB -> ((columnsA, columnsB) -> Column PGBool) -> Query (columnsA, nullableColumnsB)
Thanks,
Tom _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.

On Fri, Oct 28, 2016 at 08:53:53AM +0000, Geraldus wrote:
I see `leftJoin` signature wrapped, but not `leftJoinExplicit` for example. I suppose if you will document arguments Haddock will wrap that signatures too.
No, I want to wrap the *context* of leftJoin. Currently all three elements of the context tuple are on one line: (Default Unpackspec columnsL columnsL, Default Unpackspec columnsR columnsR, Default NullMaker columnsR nullableColumnsR) I want to see (Default Unpackspec columnsL columnsL, Default Unpackspec columnsR columnsR, Default NullMaker columnsR nullableColumnsR) Tom

Ah, sorry, got it. пт, 28 окт. 2016 г. в 14:03, Tom Ellis < tom-lists-haskell-cafe-2013@jaguarpaw.co.uk>:
On Fri, Oct 28, 2016 at 08:53:53AM +0000, Geraldus wrote:
I see `leftJoin` signature wrapped, but not `leftJoinExplicit` for example. I suppose if you will document arguments Haddock will wrap that signatures too.
No, I want to wrap the *context* of leftJoin. Currently all three elements of the context tuple are on one line:
(Default Unpackspec columnsL columnsL, Default Unpackspec columnsR columnsR, Default NullMaker columnsR nullableColumnsR)
I want to see
(Default Unpackspec columnsL columnsL, Default Unpackspec columnsR columnsR, Default NullMaker columnsR nullableColumnsR)
Tom _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.

Is there any way I can convince Haddock to wrap these contexts? Ideally I want to see something like
leftJoin :: (Default Unpackspec columnsA columnsA, Default Unpackspec columnsB columnsB, Default NullMaker columnsB nullableColumnsB) => [..]
This is a bit silly and doesn't directly address the problem, but maybe you could re-package some of the Constraints into a type synonym? (I think you would need some extension like -XConstraintKinds for that) Like this: type DefaultUnpack cols = Default Unpackspec cols cols type DefaultNull cols nCols = Default NullMaker cols nCols leftJoin :: (DefaultUnpack columnsA, DefaultUnpack columnsB, DefaultNull columnsB nullableColumnsB) => [..] Cheers, MarLinn

On Fri, Oct 28, 2016 at 07:31:54PM +0200, MarLinn via Haskell-Cafe wrote:
Is there any way I can convince Haddock to wrap these contexts? Ideally I want to see something like
leftJoin :: (Default Unpackspec columnsA columnsA, Default Unpackspec columnsB columnsB, Default NullMaker columnsB nullableColumnsB) => [..]
This is a bit silly and doesn't directly address the problem, but maybe you could re-package some of the Constraints into a type synonym? (I think you would need some extension like -XConstraintKinds for that)
Like this:
type DefaultUnpack cols = Default Unpackspec cols cols type DefaultNull cols nCols = Default NullMaker cols nCols
leftJoin :: (DefaultUnpack columnsA, DefaultUnpack columnsB, DefaultNull columnsB nullableColumnsB) => [..]
Thanks MarLinn, Your suggestion is a good one but I'd rather see if the tooling can be fixed. Tom

I have opened an issue with the same request a while ago: https://github.com/haskell/haddock/issues/472 2016-10-28 10:38 GMT+02:00 Tom Ellis < tom-lists-haskell-cafe-2013@jaguarpaw.co.uk>:
Some of my type signatures have long contexts and Haddock doesn't wrap them, pushing the more interesting information off the right hand side, e.g.:
https://hackage.haskell.org/package/opaleye-0.5.1.1/docs/ Opaleye-Join.html
Is there any way I can convince Haddock to wrap these contexts? Ideally I want to see something like
leftJoin :: (Default Unpackspec columnsA columnsA, Default Unpackspec columnsB columnsB, Default NullMaker columnsB nullableColumnsB) => Query columnsA -> Query columnsB -> ((columnsA, columnsB) -> Column PGBool) -> Query (columnsA, nullableColumnsB)
Thanks,
Tom _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.

Thanks! That's really helpful. On Fri, Oct 28, 2016 at 07:41:17PM +0200, Simon Jakobi via Haskell-Cafe wrote:
I have opened an issue with the same request a while ago: https://github.com/haskell/haddock/issues/472
2016-10-28 10:38 GMT+02:00 Tom Ellis < tom-lists-haskell-cafe-2013@jaguarpaw.co.uk>:
Some of my type signatures have long contexts and Haddock doesn't wrap them, pushing the more interesting information off the right hand side, e.g.:
https://hackage.haskell.org/package/opaleye-0.5.1.1/docs/ Opaleye-Join.html
Is there any way I can convince Haddock to wrap these contexts? Ideally I want to see something like
leftJoin :: (Default Unpackspec columnsA columnsA, Default Unpackspec columnsB columnsB, Default NullMaker columnsB nullableColumnsB) => Query columnsA -> Query columnsB -> ((columnsA, columnsB) -> Column PGBool) -> Query (columnsA, nullableColumnsB)
Thanks,
Tom
participants (4)
-
Geraldus
-
MarLinn
-
Simon Jakobi
-
Tom Ellis