Version française
Home     About     Download     Resources     Contact us    
Browse thread
difference of [< `A of & int] and [< `A of int] ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Hendrik Tews <tews@o...>
Subject: difference of [< `A of & int] and [< `A of int] ?
Hi,

I am trying to grasp the camlp4 constructor for types TyOfAmp,
which is declared as 

    | TyOfAmp of loc and ctyp and ctyp (* t of & t *)

in camlp4/Camlp4/Camlp4Ast.partial.ml. It is used in the ast of 
``[< `A of & int]''.

Can somebody explain the meaning of [< `A of & int]? What is the
difference between [< `A of & int]  and  [< `A of int] ?


And why does 

  type 'a t = [< `A of & int] as 'a

produce the weird error 

File "test/x.ml", line 1, characters 0-1:
Error: The implementation test/x.ml
       does not match the interface (inferred signature):
       Type declarations do not match:
         type 'a t = 'a constraint 'a = [< `A of & int ]
       is not included in
         type 'a t = 'a constraint 'a = [< `A of & int ]

? Is this a bug or a feature?

Bye,

Hendrik