Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.

Documentation for base-4.8.0.0 doesn't mention Show Double or Show Float instances #372

Closed
RyanGlScott opened this issue Mar 6, 2015 · 6 comments

Comments

@RyanGlScott
Copy link
Member

The current release candidate documentation for base-4.8.0.0 on Hackage does not mention the Show instance for Float in Double in any of the places that I can think of. The code for the Show instances themselves still appear to be fine (in GHC.Float).

@Fuuzetsu
Copy link
Member

Fuuzetsu commented Mar 8, 2015

That and many other instances are now not showing up but it's not due to a change on Haddock end at the very least. Maybe @hvr can explain.

@RyanGlScott
Copy link
Member Author

This issue is popping up more and more frequently. Some other victims of this issue include:

The discussion in ku-fpg/hermit#173 possibly reveals a workaround?

cc @andrewthad

@Blaisorblade
Copy link

Based on #297 (comment), #469 might be a dup. At least in the case of Text, in #469 and in ku-fpg/hermit#173, the trigger is that the datatype and the instances are not defined in the same module (even if in the same package), and the problem started with GHC 7.10 apparently.
Rather than the workaround in ku-fpg/hermit#173 (comment) (newtype wrappers to avoid orphans), which I guess is what @RyanGlScott meant to link to, most packages could just move instance definitions together with datatype definitions — or at least, text could.

@RyanGlScott
Copy link
Member Author

@Blaisorblade: By "workaround", I mean this comment in particular, which reveals how GHC solves this problem internally. I don't know if the same idea can be used in Haddock.

I agree that while most packages should just define instances alongside their datatype/class definitions, it's simply not feasible for every package. text-show in particular suffers from this, since I split up the multitude of TextShow instances across several orphan-instance containing modules to (1) avoid having to compile everything in one mega-module, which would likely eat up all your RAM, and (2) keep me sane as I try to make incremental changes when developing it.

@Blaisorblade
Copy link

@RyanGlScott Ah, now I get why you linked to that specific comment, thanks for elaborating.

I agree these orphans are fine.

OT on orphans (sorry but couldn't resist): text-show sounds like an excellent use case for modules and separate compilation! Why would anyone add restrictions on that? </snark> (The snark is not against you but against coherence).
Also, in the cases under discussion, datatypes and instances are probably exported together (modulo internal packages), so they're safe I assume. I only checked for text though.

@RyanGlScott
Copy link
Member Author

This was fixed in #724.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants