1 datatype b
= TRUE | FALSE
3 datatype nat
= Z | S
of nat
6 |
lt (S n1
, S n2
) = lt (n1
, n2
)
9 fun ZZZ_f (a
, b
) = lt (#value a
, #value b
)
11 fun ZZZ_copyTo (array
, record
as {value
, offset
}) =
12 fn S Z
=> {value
= value
, offset
= S (S (S Z
))}
15 fun ZZZ_fixTooBig (array
, record
) =
17 val left
= array (S Z
)
18 val right
= array (S (S Z
))
20 case ZZZ_f (left
, right
) of
24 case ZZZ_f (record
, small
) of
25 TRUE
=> ZZZ_copyTo (array
, record
)
26 | FALSE
=> ZZZ_copyTo (array
, small
)