typechecking (except for compositions) is implemented and has pretty error messages