implementation of if

This is a function to implement if in Haskell. cf. CS61A if.py