modify the list unification to support the form of head|tail