type checking with T-app T-fun