simple implementation of Curry Type System