Opened 2 years ago
Closed 2 years ago
#13206 closed bug (fixed)
Error in GHC.Generics documentation
Reported by: | dsf | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 8.2.1 |
Component: | libraries/base | Version: | 8.0.1 |
Keywords: | Generics | Cc: | |
Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
Type of failure: | None/Unknown | Test Case: | |
Blocked By: | Blocking: | ||
Related Tickets: | Differential Rev(s): | ||
Wiki Page: |
Description
The Generic instance shown as automatically derived for the Tree type should read
instance Generic (Tree a) where type Rep (Tree a) = D1 ('MetaData "Tree" "Main" "package-name" 'False) (C1 ('MetaCons "Leaf" 'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: C1 ('MetaCons "Leaf" 'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Tree a)) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Tree a))))) from (Leaf f) = M1 (L1 (M1 (M1 (K1 f)))) from (Node f g) = M1 (R1 (M1 ((M1 (K1 f)) :*: (M1 (K1 g))))) to (M1 (L1 (M1 (M1 (K1 f))))) = Leaf f to (M1 (R1 (M1 ((M1 (K1 f)) :*: (M1 (K1 g)))))) = Node f g
Change History (7)
comment:1 Changed 2 years ago by
comment:2 Changed 2 years ago by
Keywords: | Generics added |
---|
Forgive me for being slow, but which specific lines in the current GHC.Generics
source code are wrong? And what in particular do you wish to change? It's hard to discern from all the autogenerated noise.
comment:3 Changed 2 years ago by
If you go to https://hackage.haskell.org/package/base-4.9.1.0/docs/GHC-Generics.html it is the second block of code. It is near the top of http://git.haskell.org/ghc.git/blob_plain/HEAD:/libraries/base/GHC/Generics.hs. I'm only talking about the comments.
comment:4 Changed 2 years ago by
dsf, I presume you're referring to this? http://git.haskell.org/ghc.git/blob/4441f90738e27ea7ba368723f27d19c03093aa66:/libraries/base/GHC/Generics.hs#l75
Granted, my eyes aren't as sharp as they used to be, but from a glance, that Rep (Tree a)
instances appears to be the same as yours. So can you point to the specific part that you claim is incorrect?
comment:5 Changed 2 years ago by
It turns out its just this:
--- old 2017-01-29 21:28:30.598988361 -0800 +++ new 2017-01-29 21:28:46.650987621 -0800 @@ -2,7 +2,7 @@ type Rep (Tree a) = D1 ('MetaData "Tree" "Main" "package-name" 'False) (C1 ('MetaCons "Leaf" 'PrefixI 'False) - (S1 '(MetaSel 'Nothing + (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy)
comment:7 Changed 2 years ago by
Milestone: | → 8.2.1 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Ah, sharp eye! Thanks for the catch, I've since applied your fix in HEAD.
I mean