doc-src/Tutorial/Misc/Sep2.thy
author paulson
Fri, 19 Mar 2004 10:42:38 +0100
changeset 14472 cba7c0a3ffb3
parent 5377 efb799c5ed3c
permissions -rw-r--r--
Removing the datatype declaration of "order" allows the standard General.order to be used. Thus we can use Int.compare and String.compare instead of the slower home-grown versions.

Sep2 = List +
consts sep :: "'a * 'a list => 'a list"
recdef sep "measure (%(a,xs). length xs)"
    "sep(a, x#y#zs) = x # a # sep(a,y#zs)"
    "sep(a, xs)     = xs"
end