Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Simple(?) subtyping problem...
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Till Varoquaux <till.varoquaux@g...>
Subject: Simple(?) subtyping problem...
I'm currently trying to split functions matching against given variant
type and I'm running across this pb:

let a= function
 | `A -> ()
 | `B -> ()

doesn't split into

let c=function
 | `B -> ()

let b =function
 | `A -> ()
 |  x -> c x

since it messes up the type rules. I really want to avoid having to
write down precise type informations (The point here is to have an
extensible system)...

I am sure this question has been asked loads of times (but I couldn't
find the right thread in the archives) and I apologize for asking it
yet again.