
23 Oct
2007
23 Oct
'07
3:10 a.m.
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] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH