[GHC] #13328: Foldable, Functor, and Traversable deriving handle phantom types badly
GHC
ghc-devs at haskell.org
Fri Feb 24 02:16:11 UTC 2017
#13328: Foldable, Functor, and Traversable deriving handle phantom types badly
-------------------------------------+-------------------------------------
Reporter: dfeuer | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone: 8.4.1
Component: Compiler | Version: 8.1
Resolution: | Keywords: deriving-perf
Operating System: Unknown/Multiple | Architecture:
Type of failure: Runtime | Unknown/Multiple
performance bug | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by dfeuer):
No, you have to pick efficiency or strictness here. The bottom could show
up anywhere down the line. I think derived instances should generally go
for what someone's likely to write by hand, rather than trying to imitate
the lousy results of the default. The default implementation of `null`
will diverge on an infinite snoc-list, but that doesn't mean the derived
implementation should. I think the same is true here. If the type is
phantom, there's no possible reason to go there, so we shouldn't.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13328#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list