Hi, I'm doing logic exercises with haskell and I have to extract the value from the middle of a tuple of 3 using the "maximum" and "minimum" functions developed below.
maximo :: (Int,Int)->Int
maximo (x,y) = if x > y then x else y
minimo :: (Int,Int)->Int
minimo (x,y) = if x < y then x else y
med :: (Int,Int,Int)->Int
med (x,y,z) = // funcion med
main = do
print(med(4,3,5))
I've been testing several combinations but there's always at least one case where it fails.
Could someone help me?
Thank you very much