adamc@196: datatype list a = Nil | Cons of a * list a adamc@196: adamc@196: val isNil = fn t ::: Type => fn ls : list t => adamc@196: case ls of Nil => True | _ => False adamc@196: adamc@196: val show = fn b => if b then "True" else "False" adamc@196: adamc@196: val rec delist : list string -> xml body [] [] = fn x => adamc@196: case x of adamc@196: Nil =>
Nil adamc@196: | Cons (h, t) => {cdata h} :: {delist t} adamc@196: adamc@196: val main : unit -> page = fn () => adamc@196: {cdata (show (isNil (Nil : list bool)))}, adamc@196: {cdata (show (isNil (Cons (1, Nil))))}, adamc@196: {cdata (show (isNil (Cons ("A", Cons ("B", Nil)))))} adamc@196: adamc@196:{delist (Cons ("X", Cons ("Y", Cons ("Z", Nil))))}
adamc@196: