Quantcast
Channel: Active questions tagged ocaml - Stack Overflow
Viewing all articles
Browse latest Browse all 531

How can I force a record literal to have a type in OCaml? [duplicate]

$
0
0

I have some record types with overlapping fields. This causes a type mismatch:

type apple =  {    price : int  }type banana =  {    price : int  }

Is it possible to force the type of a record literal to be one or the other?

(Hypothetical syntax)

{  apple.price = 123}
{  banana.price = 123}

Viewing all articles
Browse latest Browse all 531

Trending Articles