question about haskell report terminology

Bernard James POPE bjpop@cs.mu.OZ.AU
Fri, 29 Nov 2002 12:36:54 +1100 (EST)


Hi All,

In section 4.4.3 "Function and Pattern Bindings" of the Haskell 98 Report,
it gives the following translation:

----
   (The general binding form of a function is):

   x p_11 ... p_1k match_1
   ...
   x p_n1 ... p_nk match_n
   
   Translation: The general binding form for functions is semantically
   equivalent to the equation (ie simple pattern binding): 

   x = \x_1 ... x_k -> case (x_1, ..., x_k) of
                        (p_11, ..., p_1k) match_1
                        ...
                        (p_n1, ..., p_nk) match_n

   where x_i are new identifiers
----

What does it mean by "semantically equivalent". A rough approximation is
"has the same meaning", but that depends on how you define the "meaning".

For example:

   foo x = show x
      versus
   foo = \x -> show x

I think the answer to the question is something like: this rule is intended
to translate Haskell into the kernel, but it is not an equivalence that the
programmer may (always) use in their own program (ie it is applicable only
after type checking). I'm not sure where this rule fits into the
definition of the language.

Cheers,
Bernie.