Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. COI disagree with both these answers. The first one because it is _very_ common to have `Eq` instances for infinite data that work exactly as you describe, and since we can represent many functions simply as infinite mappings of input -> output the problem is in fact much the same. Dragging Godel into this seems rather far-fetched (and even dragging in the halting problem is besides the point). Your second point feels similarly silly.
      singulars
    2. COThe real issue in both cases is intensional vs. extensional equality (or i guess syntactic vs semantic). The semantics of Haskell dictate the latter but all we can capture for your proposed `Show` is the former. `Eq`, on the other hand, is possible over finite domain things, but that's a narrow subset of what we might want, and inefficient to boot.
      singulars
    3. CONo, @sclv, Godel's incompleteness Theorem _is_ relevant. Consider a function that returns all the even numbers and another one that returns the even numbers that are the sum of two smaller primes. Are they equal? I'm impressed if you can write a Haskell program that can solve a problem unsolved by mathematicians for centuries, and which we don't know is solvable. Godel shows that there are unprovable truths in any mathematical system sophisticated enough to include arithmetic - so any Eq instance for functions must be incorrect or incomplete, and incomplete in the sense of does not terminate.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload