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

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 591

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>