36 |
| _ => true) |
| _ => true) |
37 |
| notconst _ = true |
| notconst _ = true |
38 |
|
|
|
(* |
|
|
* fun show((sym,_,_)::syms, r::rs) = |
|
|
* (print(Symbol.name sym); print ": "; |
|
|
* PPBasics.ppRep r; print "\n"; show(syms,rs)) |
|
|
* | show _ = (print "\n") |
|
|
*) |
|
|
|
|
39 |
(* the first argument indicates whether this is a recursive datatypes *) |
(* the first argument indicates whether this is a recursive datatypes *) |
40 |
fun infer false ([(_, false, CONty(_,[ty,_]))]) = |
fun infer false ([(_, false, CONty(_,[ty,_]))]) = |
41 |
(case (reduce ty) |
(case (reduce ty) |
66 |
in decide(0, 0, cons, []) |
in decide(0, 0, cons, []) |
67 |
end |
end |
68 |
|
|
69 |
(*** val infer = fn l => let val l' = infer l in show(l,l'); l' end ***) |
(** rebind infer for debugging purpose **) |
70 |
|
local |
71 |
|
val pps = PrettyPrint.mk_ppstream |
72 |
|
{consumer=TextIO.print, |
73 |
|
linewidth=80, |
74 |
|
flush = fn() => TextIO.flushOut TextIO.stdOut} |
75 |
|
|
76 |
|
fun show((sym,_,_)::syms, r::rs) = |
77 |
|
(print(Symbol.name sym); print ": "; |
78 |
|
PPVal.ppRep pps r; print "\n"; show(syms,rs)) |
79 |
|
| show _ = (print "\n") |
80 |
|
|
81 |
|
fun dbg flag cons = |
82 |
|
let val result = infer flag cons |
83 |
|
in |
84 |
|
if !Control.CG.etdebugging then |
85 |
|
show(cons, #1 result) |
86 |
|
else (); |
87 |
|
result |
88 |
|
end |
89 |
|
in |
90 |
|
val infer = dbg |
91 |
|
end (* local debugging *) |
92 |
|
|
93 |
|
|
94 |
end (* local *) |
end (* local *) |
95 |
|
|
96 |
end (* structure ConRep *) |
end (* structure ConRep *) |
97 |
|
|
98 |
|
|