[Caml-list] Error: In the definition of t, type ('a, 'b) t should be ('b, 'a) t

2010-01-05 Thread Edgar Friendly
This error message was new to me, and I wondered what's going on and why: # type ('a, 'b) t = [ `A | `T of ('b, 'a) t ];; Error: In the definition of t, type ('a, 'b) t should be ('b, 'a) t I can get unhelpful suggestions through foolishness with three type parameters: # type ('a, 'b, 'c) t = [

Re: [Caml-list] Error: In the definition of t, type ('a, 'b) t should be ('b, 'a) t

2010-01-05 Thread Jacques Garrigue
From: Edgar Friendly > This error message was new to me, and I wondered what's going on and > why: > > # type ('a, 'b) t = [ `A | `T of ('b, 'a) t ];; > Error: In the definition of t, type ('a, 'b) t should be ('b, 'a) t Structural recursive types (objects and polymorphic variants) must be regul