weight, chars, times, makeOrderedLeafList, singleton, combine, until, createCodeTree functions for pattern matching assignment