Question: Explain why the SML interpreter accepts the declarations datatype 'a FBtree = node of 'a * 'a FBtree list; fun dfs P (t: 'a FBtree)
Explain why the SML interpreter accepts the declarations datatype 'a FBtree = node of 'a * 'a FBtree list; fun dfs P (t: 'a FBtree) = let exception Ok of 'a; fun auxdfs( node(n,F) ) = if P n then raise Ok n else foldl (fn(t,_) => auxdfs t) NONE F; in auxdfs t handle Ok n => SOME n end; while it does not accept the declaration exception Ok of 'a;
Step by Step Solution
3.44 Rating (163 Votes )
There are 3 Steps involved in it
The detailed answer for the above question is provided below The SML interpreter accepts the declara... View full answer
Get step-by-step solutions from verified subject matter experts
