fork download
  1. type int_unit = Int of int | Unit of unit;;
  2. type str_float = String of string | Float of float;;
  3. type everything = Int_Unit of int_unit | Str_Float of str_float;;
  4.  
  5. let f = function
  6. | Int_Unit iu -> begin match iu with
  7. | Int _ -> "int"
  8. | Unit _ -> "unit"
  9. end
  10. | Str_Float sf -> begin match sf with
  11. | Float _ -> "float"
  12. | String _ -> "string"
  13. end
Success #stdin #stdout 0.01s 2736KB
stdin
Standard input is empty
stdout
Standard output is empty