English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
define incompatible type
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-02-12 (06:32)
From: Grégoire_Seux <kamaradclimber@g...>
Subject: define incompatible type
hello !

i would like to create two types and use the type checker to verify the
"meaning" of my programs:

type user_id = int

type movie_id = int

i'd like if the type checker would warn me if i write something that is

> let a:user_id = 57 and b:movie_id = 80 in

if a=b then ...

because this is obvioulsy a mistake

do you know if is this possible ?
thanks by advance !