10.04.2012, 02:00, "Ryan Ingram" <ryani.s...@gmail.com>:
> A concurring opinion here, and an example.
>
> iff :: Bol -> a -> a -> a
> iff True x _ = x
> iff False _ x = x
>
> f, g :: Bool -> Bool
> f x = x
> g x = iff x True False
>
> Are these two functions equal?  I would say yes, they are.  Yet once you can 
> pattern match on functions, you can easily tell these functions apart, and 
> create a function
>
> h :: (Bool -> Bool) -> Bool
> such that h f => True but h g => False.
>
>   -- ryan

I've just remembered an interesting statement that there is a language where 
each equivalence class of programs Dan Doel mentioned (f = g  iff  forall x. f 
x = g x) has a single program in it. That is there is a one-to-one 
correspondence between programs and functions. Though as far as I understood 
one cannot construct a translator from this language to another language.

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to