Version française
Home     About     Download     Resources     Contact us    
Browse thread
The need to specify 'rec' in a recursive function defintion
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Francois Maurel <Francois.Maurel@n...>
Subject: Re: [Caml-list] The need to specify 'rec' in a recursive function defintion
>
>
> # let y = z z ;;
> val y : (('_a -> '_b) -> '_a -> '_b) -> '_a -> '_b = <fun>
>
> Can anyone get rid of the pesky underscores in the type of y above, so
> that it becomes truly polymorphic?
>

Eta expansion does it...

# let y x = z z x;;
val y : (('a -> 'b) -> 'a -> 'b) -> 'a -> 'b = <fun>

Regards,
François