Browse thread
The need to specify 'rec' in a recursive function defintion
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ 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