Opened 2 years ago

Closed 2 years ago

#14199 closed bug (fixed)

Document Type.Reflection better (Fun and Con')

Reported by: dfeuer Owned by:
Priority: high Milestone: 8.2.2
Component: Core Libraries Version: 8.2.1
Keywords: Typeable Cc: bgamari
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Documentation bug Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s): Phab:D3943, Phab:D3991
Wiki Page:

Description

The pattern synonym Type.Reflection.Fun is not documented at all. Since it seems a bit subtle ((->) being more than just a type constructor), I think it actually deserves extra documentation, with examples.

The pattern synonym Type.Reflection.Con' is insufficiently documented. Some examples would probably help.

Change History (13)

comment:1 Changed 2 years ago by dfeuer

Component: CompilerCore Libraries

comment:2 Changed 2 years ago by bgamari

Owner: set to bgamari

comment:3 Changed 2 years ago by bgamari

Differential Rev(s): Phab:D3943
Status: newpatch

comment:4 Changed 2 years ago by Ben Gamari <ben@…>

In f9bf621/ghc:

Better document TypeRep patterns

As pointed out in #14199 these are rather non-trivial; extra
documentation is in order.

[skip ci]

Test Plan: Read it

Reviewers: dfeuer, austin, hvr

Subscribers: rwbarton, thomie

GHC Trac Issues: #14199

Differential Revision: https://phabricator.haskell.org/D3943

comment:5 Changed 2 years ago by bgamari

Status: patchmerge

comment:6 Changed 2 years ago by dfeuer

I think it would be helpful to explain, in the documentation of Con' and App, just what separates the variables that can be separated with App from the ones that can be separated with Con'. For example, given

data Foo j k (l :: j -> k)

one might naively expect something like App (App (App (Con Foo) Bool) Type) SBool, but that is not so. Going into a bit more detail about that would be helpful, and it might even be worth mentioning why the naive guess is wrong.

comment:7 Changed 2 years ago by bgamari

Thanks David, that is quite helpful feedback.

comment:8 Changed 2 years ago by bgamari

Differential Rev(s): Phab:D3943Phab:D3943, Phab:D3991

There's some more documentation improvements in Phab:D3991.

comment:9 Changed 2 years ago by bgamari

Owner: bgamari deleted
Status: mergenew

comment:11 Changed 2 years ago by Ben Gamari <ben@…>

In 6de1a5a9/ghc:

Document Typeable's treatment of kind polymorphic tycons

Test Plan: Read it

Reviewers: dfeuer, goldfire, austin, hvr

Reviewed By: dfeuer

Subscribers: rwbarton, thomie

GHC Trac Issues: #14199

Differential Revision: https://phabricator.haskell.org/D3991

comment:12 Changed 2 years ago by bgamari

Status: newmerge

comment:13 Changed 2 years ago by bgamari

Resolution: fixed
Status: mergeclosed
Note: See TracTickets for help on using tickets.