tuples - Guards in Haskell, performing operations using checks -
so have searched different ways of approaching "if" statements in haskell , have doubt guards, have tuple , want perform +,-,*,/ checking conditions: given (x,y) if x < y +,* want integers, furthermore check division x mod y == 0 or not, compiles can-t run operaciones (x,y) = (x,y) x,y | x < y = [(x, y, '+', x+y), (x, y, '*', x*y)] | (x > y) && (x `mod ` y == 0) = [(x, y, '+', x+y), (x, y, '*', x*y), (x, y, '-', x-y) , (x, y, '/', x/y)] | (x > y) && (x `mod ` y /= 0) = [(x, y, '+', x+y), (x, y, '*', x*y), (x, y, '-', x-y)] | otherwise = [(x, y, '+', x+y), (x, y, '*', x*y), (x, y, '-', x-y) , (x, y, '/', x/y)] i took idea haskell: multiple case statements in single function but failed, otherwise if x == y i wouldn't recommend style; you're repeating way much. understand it, want function: operaci...