[Haskell-beginners] Pattern matching over functions

Graham Gill math.simplex at gmail.com
Sun Dec 11 19:07:06 CET 2011


On 10-Dec-2011 11:17 AM, Ken KAWAMOTO wrote:
> On Thu, Dec 8, 2011 at 3:14 PM, Brent Yorgey<byorgey at seas.upenn.edu>  wrote:
>> On Wed, Dec 07, 2011 at 06:10:01PM +0100, Giacomo Tesio wrote:
>>> I would find already very useful a compiler that is able to understand id f
>>> = f, that (\x ->  3 + x) == (\y = 3 + y) == (+3) even if it isn't able to
>>> see that (+3) == (\x ->  2 + 1 + x).
>> But then we would lose referential transparency.
> As I understand, this would be against lazy evaluation since it would
> request to evaluate expressions in lambda, but I don't see how this
> relates to referential transparency.
> Can you elaborate this a little bit?

I second the question. From what I understand referential transparency 
means that an expression can be replaced by its value with no change to 
program semantics, or equivalently that a function always produces the 
same result/behaviour given the same input. How does determining whether 
two (pure) functions are equivalent break referential transparency?

cheers!
Graham

>
> Thanks,
> Ken
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners



More information about the Beginners mailing list