[GHC] #9674: Foldable doesn't have any laws

GHC ghc-devs at haskell.org
Fri Oct 10 18:10:57 UTC 2014


#9674: Foldable doesn't have any laws
-------------------------------------+-------------------------------------
              Reporter:  dfeuer      |            Owner:  ekmett
                  Type:  task        |           Status:  new
              Priority:  normal      |        Milestone:  7.10.1
             Component:  Core        |          Version:  7.8.3
  Libraries                          |         Keywords:
            Resolution:              |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Unknown
  Unknown/Multiple                   |       Blocked By:
       Type of failure:              |  Related Tickets:
  Documentation bug                  |
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by ekmett):

 `foldMap f = fold . fmap f` assumes you have a `Functor` instance as well,
 so any such law would need that caveat.

 `fold = foldMap id` holds universally.

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


More information about the ghc-tickets mailing list