Standard ML Syntax
问题 I'm new to Standard ML and trying to write the following code fun whilestat test stmt1 = (fn x => if (test x) then (stmt1 x;whilestat test stmt1 ) else (x) ); The issue is that it gives me the following error w.sml:21.6-22.82 Error: right-hand-side of clause doesn't agree with function result type [circularity] expression: ('Z -> 'Y) -> 'Z -> 'Z result type: ('Z -> 'Y) -> 'Z in declaration: whilestat2 = (fn arg => (fn <pat> => <exp>)) uncaught exception Error raised at: ../compiler/TopLevel