datatype 'a linkedList = Nil | Cell of {element: 'a, next: 'a linkedList ref}; exception BadCell; fun skip Nil = raise BadCell | skip(Cell{next = ref Nil,...}) = raise BadCell | skip(Cell{next = x as ref(Cell{next=y,...}),...}) = x := !y;