implement a bool typed lambda type checker