On Oct 22, 2007, at 22:41 , PR Stanley wrote:

f x = x
x :: a
f x :: b
therefore f :: a -> b
x = a and x = b
therefore a = b
therefore f :: a -> a
Simple mappings are easy to work out. It's the more detailed stuff I'm not sure about.
f g x y = g x (y x)

I think you're looking for Hindley-Milner type inference. (GHC actually uses a more complex system known as System Fc, but probably want to start with H-M.) _Types and Programming Languages_ is a good place to start if you want to learn about the H-M family.

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon university    KF8NH


_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to