csci2041/public-class-repo/SamplePrograms/Intervals/v4/useInterval.ml
Michael Zhang 399845160c
f
2018-01-29 17:35:31 -06:00

23 lines
488 B
OCaml

open IntInterval
open Intervals
open StringInterval
let i1 = Int_interval.create 3 4
let i2 = Int_interval.create 3 6
let s1 = String_interval.create "a" "d"
let () =
print_endline ("An interval: " ^ Int_interval.to_string i1) ;
print_endline ("Another interval: " ^ Int_interval.to_string i2) ;
print_endline ("Their intresection: " ^
Int_interval.to_string (Int_interval.intersect i1 i2)) ;
print_endline ("A string interval: " ^ String_interval.to_string s1)