Making lattice functions type-bound WIP #313