Qestion how do you write an equality operator call it


In OCaml, a type 'yearday' is defined as follows:

type yearday = YMD of int * int * int | YD of int * int;;

Example: YMD(2015, 7, 4) is July 4th, 2015 and YD(2015, 185) is also July 4th, 2015

Question: How do you write an equality operator (call it =/) that determines if two yearday instances are equal?

In the above example, YMD(2015, 7, 4) =/ YD(2015, 185) is true.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Qestion how do you write an equality operator call it
Reference No:- TGS02878122

Expected delivery within 24 Hours