28 Feb
2005
28 Feb
'05
9:19 a.m.
On Mon, 28 Feb 2005 03:50:14 -0500 Jim Apple <japple@freeshell.org> wrote:
Is there a type we can give to
y f = f . f
y id y head y fst
are all typeable?
Using ghci: Prelude> let y f = f.f Prelude> :t y y :: forall c. (c -> c) -> c -> c So it admits principal type (a->a) -> a->a. From this you can see that (y head) and (y fst) cannot be typed, whereas (y id) can. BTW, this function is usually named 'twice'. Best regards, Pedro -- Pedro Vasconcelos, School of Computer Science, University of St Andrews ----------------------------------------------------------------------- "The difference between Theory and Practice is greater in Practice than in Theory."