doc-src/Tutorial/Datatype/update
author wenzelm
Fri, 21 Dec 2001 23:16:17 +0100
changeset 12587 3f3d2ffb5df5
parent 5851 15ce4c1c8313
permissions -rw-r--r--
HOL/record: shared operations ("more", "fields", etc.) now need to be always qualified;

consts update :: ('a,'v)trie => 'a list => 'v => ('a,'v)trie

primrec
  "update t []     v = Trie (Some v) (alist t)"
  "update t (a#as) v = (let tt = (case assoc (alist t) a of
                                    None => Trie None [] | Some at => at)
                        in Trie (value t) ((a,update tt as v)#alist t))"