Sep 14, 2010

Haskell if else statement

You can write a if else statment like this.

function_name x =
if x<0 -1 else 1 if you write this as; function_name 5 it will give the output as; 0 And also you can write if then else statment also. function_name y = if y<0 -1 else if y>0

No comments:

Post a Comment

Your comments are always welcome ...