List Info

Thread: "ocaml_beginners"::[] On applying a polymorphic value to a ploymorphic function




"ocaml_beginners"::[] On applying a polymorphic value to a ploymorphic function
user name
2006-09-26 11:09:22

doug_arro wrote:

> Then it gives an example like this:
>;
> # (function x -> x) [] ;;
> - : '_a list = []
>
> I tried the same in my OCaml 3.09 on Windows XP but got an different
> result:
>
> # (function x -> x) [] ;;
> - : 'a list = []

On page 58 it also gives an example

# let f x = [] ;;
val f : 'a -> 'b list = <fun>;

# f () ;;
- : '_a list = []

However I get the results...

# let f x = [] ;;
val f : 'a -> 'b list = <fun>;

# f () ;;
- : 'a list = []

Rónán

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )