Tuesday, December 07, 2010

Generic types and type inference (F#, ...)

Do not expect:
match x with | Fail _ as z-> z | ...
to be the same as
match x with | Fail d -> Fail d | ...

This is because the first variant will output the same type as there input while the second variant creates new type variable which may or not end up to be the same type as the input arguments.

No comments: