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
define incompatible type
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
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 !