[GHC] #15339: Add function equality instance for finite functions to base

#15339: Add function equality instance for finite functions to base -------------------------------------+------------------------------------- Reporter: madgen | Owner: (none) Type: feature | Status: new request | Priority: normal | Milestone: 8.6.1 Component: | Version: 8.4.3 libraries/base | Keywords: base, | Operating System: Unknown/Multiple equality, function | Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- If the input type is bounded and enumerable and the result type can be compared for equality, functions can be checked for equality. Basically this instance: {{{#!hs instance (Bounded a, Enum a, Eq b) => Eq (a -> b) where f == g = all (\x -> f x == g x) [ minBound..maxBound ] }}} I often work with functions with finite domains and find [(a,b)] awkward. I thought this is generic enough that it might belong to base. I'd also submit a patch, but I couldn't quite figure out where it should live. GHC.Base doesn't have Enum and Bounded; Enum is not where -> or Eq are declared; Eq is not declared anywhere; and Data.Function is only for combinators. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15339 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15339: Add function equality instance for finite functions to base -------------------------------------+------------------------------------- Reporter: madgen | Owner: (none) Type: feature request | Status: closed Priority: normal | Milestone: 8.6.1 Component: libraries/base | Version: 8.4.3 Resolution: invalid | Keywords: base, | equality, function Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by goldfire): * status: new => closed * resolution: => invalid Comment: This should really go to the `libraries@haskell.org` mailing list. Thanks for contributing here, but I will close this ticket as out of scope. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15339#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC