Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlug] Re: Y Combinator



John Fremlin writes:

 > > fix :: (a -> a) -> a
 > > fix f = let x = f x in x

 > The main thing that puzzled me is that the type of fix is
 > 
 > fix :: (a -> a) -> a
 > 
 > but "a" must in fact have type
 > 	b -> b
 > because it's used as a function.

Is that a question, or does the past tense mean you got it?

Of course f is used as a function and thus must have a type of the
form (a -> b), to have a fixed point it must be that a = b, and the
fixed point itself must have the type a.  Ergo

fix :: (a -> a) -> a




Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links