Microsoft Windows [Version 10.0.18363.1316] (c) 2019 Microsoft Corporation. All rights reserved. C:\Users\Classroom\Desktop\hw2>"SML of New Jersey.lnk" Standard ML of New Jersey (32-bit) v110.99 [built: Thu Dec 24 11:01:10 2020] - - use "exercise4.sml"; [opening exercise4.sml] val min3 = fn : 'a * 'b * 'c -> 'a val it = () : unit - - use "exercise4.txt"; [opening exercise4.txt] val min3 = fn : 'a * 'b * 'c -> 'a val it = () : unit - - use "exercise4.java"; [opening exercise4.java] val min3 = fn : 'a * 'b * 'c -> 'a val it = () : unit - - fun f x = x * x; val f = fn : int -> int - - 5 * 6; val it = 30 : int - 4.0 * 3.0; val it = 12.0 : real - f 6; val it = 36 : int - f 9; val it = 81 : int - f 0; val it = 0 : int - f 1; val it = 1 : int - f(9); val it = 81 : int - (f 8); val it = 64 : int - f 7; val it = 49 : int - f 7.0; stdIn:20.1-20.6 Error: operator and operand do not agree [tycon mismatch] operator domain: int operand: real in expression: f 7.0 - - fun g x:real = x * x; val g = fn : real -> real - - fun h x = 1.0 * x * x; val h = fn : real -> real - - fun h x = 2 * x * x; val h = fn : int -> int - - fun h x = 2.0 * x * x; val h = fn : real -> real - - fun h x:real = 2 * x * x; stdIn:26.5-26.25 Error: right-hand-side of clause does not agree with function result type [overload - bad instantiation] expression: 'Z[INT] result type: real in declaration: h = (fn x => 2 * x * x: real) - - fun h x:real = 2.0 * x * x; val h = fn : real -> real - - fun h x = 2.0 * x * x; val h = fn : real -> real - - fun f x y = x ^ y; val f = fn : string -> string -> string - - f "cat" "dog"; val it = "catdog" : string - f "123" "345"; val it = "123345" : string - - f("123" "345"); stdIn:33.3-33.14 Error: operator is not a function [tycon mismatch] operator: string in expression: "123" "345" - - f("123", "345"); stdIn:1.2-1.17 Error: operator and operand do not agree [tycon mismatch] operator domain: string operand: string * string in expression: f ("123","345") - - (f "123" "345"); val it = "123345" : string - - f "56" "dog"; val it = "56dog" : string - - h 5.0; val it = 50.0 : real - h; val it = fn : real -> real - f; val it = fn : string -> string -> string - - - str 67; stdIn:46.1-46.7 Error: operator and operand do not agree [overload - bad instantiation] operator domain: char operand: 'Z[INT] in expression: str 67 - - str #"g"; val it = "g" : string - - fun g x y = x + ord y; val g = fn : int -> char -> int - - g 10 #"7"; val it = 65 : int - g 10 #"u"; val it = 127 : int - - Int.toString 45; [autoloading] [library $SMLNJ-BASIS/basis.cm is stable] [library $SMLNJ-BASIS/(basis.cm):basis-common.cm is stable] [autoloading done] val it = "45" : string - Int.toString 45; val it = "45" : string - - real 4; val it = 4.0 : real -