Version française
Home     About     Download     Resources     Contact us    
Browse thread
When is a function polymorphic?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Yaron Minsky <yminsky@g...>
Subject: When is a function polymorphic?
I don't understand the following results.  It seems like these two
examples should have the same type.  In this example, there isn't much
of a difference between the two cases, but there are cases where this
idiom is quite convenient.  Any idea how to salvage it?

# function Some x -> Some () | None as x -> x;;
- : 'a option -> unit option = <fun>
# function Some x -> Some () | x -> x;;
- : unit option -> unit option = <fun>


Yaron