theory Test imports "~~/src/HOL/HOLCF/HOLCF" begin fun len where "len xs = (case xs of [] \ 0 | _ # xs \ Suc (len xs))" no_notation List.Nil ("[]") domain 'a list ("[_]") = Nil ("[]") | Cons (lazy head :: 'a) (lazy tail :: "['a]") (infixr ":" 65) fixrec bla where "bla\xs\y = (case xs of [] \ y | x : xs \ y)" fixrec scanr :: "('a \ 'b \ 'b) \ 'b \ ['a] \ ['b]" where "scanr\f\q0\[] = q0:[]" | "scanr\f\q0\(x : xs) = ( let qs = scanr\f\q0\xs in (case qs of [] \ \ | q : qs' \ f\x\q : qs))" end