Proper formatting of switch function in haskell.