Version française
Home     About     Download     Resources     Contact us    
Browse thread
Troublesome nodes
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jacques Carette <carette@m...>
Subject: Re: [Caml-list] Troublesome nodes
Wolfgang Lux wrote:
> This problem is apparently easy to solve. Just don't expect an exact 
> super_node_t list argument for the bold function. Instead use
>   val bold : [< super_node_t] list -> nonlink_node_t
> in the signature and
>   let bold seq = `Bold (seq :> super_node_t list)
> in the body of the Node module's definition.
Indeed, works like a charm.  You don't even need the coercion in the 
body of 'bold' for it to work.

This will hopefully allow me to remove some coercions from my own code, 
and use subtype annotations in the types.

Jacques