[GHC] #10065: Definition of fix lacks commentary

GHC ghc-devs at haskell.org
Wed Feb 4 17:14:03 UTC 2015


#10065: Definition of fix lacks commentary
-------------------------------------+-------------------------------------
              Reporter:  dfeuer      |             Owner:  dfeuer
                  Type:  bug         |            Status:  new
              Priority:  normal      |         Milestone:
             Component:  Core        |           Version:  7.11
  Libraries                          |  Operating System:  Unknown/Multiple
              Keywords:              |   Type of failure:  Documentation
          Architecture:              |  bug
  Unknown/Multiple                   |        Blocked By:
             Test Case:              |   Related Tickets:
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
 In `Data.Function`,

 {{{#!hs
 fix :: (a -> a) -> a
 fix f = let x = f x in x
 }}}

 It is not immediately obvious why it is defined like this, rather than the
 more natural

 {{{#!hs
 fix f = f (fix f)
 }}}

 There are very good reasons for this; notably, it allows for the
 definition of circular data structures. But there should be a comment
 explaining this, preferably in the Haddocks.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10065>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list