module L =
struct
class ['a] nil = ['a] Liste1.nil
class ['a] cons = ['a] Liste1.cons
class ['a] append l r =
object (self : 'mytype)
val left = (l : 'mytype)
val right = (r : 'mytype)
method null = left # null && right # null
method hd =
if left # null then right # hd
else (left # hd : 'a)
method tl =
if left # null then right # tl
else if left # tl # null then right
else {< left = left # tl >}
method length = left # length + right # length
end
end;;
|
|