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
Efficency of varient types
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-11-28 (07:24)
From: David Baelde <david.baelde@g...>
Subject: Re: [Caml-list] Efficency of varient types

First, I'd like to point that you're talking about sum types and not
variants. For short, variants are the backquoted labels `Int of int,
and I think they cost more at runtime, for they cannot be encoded as

My solution for your problem would be to write a simple type inference
in order to check your scheme programs before translating. It's not so
hard if you use tools like lambda-prolog for example. Of course you
won't be able to translate untypable programs, but I think that's no
problem. The only difficulty which I foresee is having polymorphism
infered, at least it is not obvious to do with lambda-prolog, and
you'll probably miss it.