question about haskell report terminology

Bernard James POPE bjpop@cs.mu.OZ.AU
Fri, 29 Nov 2002 15:47:55 +1100 (EST)


> > For example:
> >
> >   foo x = show x
> >      versus
> >   foo = \x -> show x
> 
> And, why not the simplest version: "foo = show"...
> 
> If we call these three versions "foo1", "foo2" and "foo3", then they are
> semantically equivalent because, besides having the same type, one can
> substitute one with anyone of the others; if we have the definition
> 
> 	g = foo1 "Hello"
> 
> we can replace "foo1" with either "foo2" or "foo3" and get the exact
> same behavior (or operational semantics, if you prefer):
> 
> 	g = foo2 "Hello"

Thanks for your helpful comments David,

I should have mentioned why I picked this example. In the absence of a
suitable type signature, foo2 and foo3 won't pass the monomorphism restriction.
So I can't freely apply the rule to my program as a transformation from
Haskell to Haskell and always preserve the static properties of my
program. 

However, you have answered my question, in that the semantics that the rule
is talking about is the operational semantics. 

Cheers,
Bernie.