>I was suppose to find a function mid3 that takes three integers and returns 
>the middle one in terms of size but i cant seem to get it.
>maybe you can help
>
>mid3 :: Int -> Int -> Int -> Int
>-- mid3 takes three integers and 
>-- returns the middle one in terms of size
>mid3 x y z = min2 x (max2 y z)

The only problem I can see with this definition is that if you hadn't 
previously defined min2 and max2, then it would fail, since these aren't in 
the prelude.  However, if you replace those with min and max, it seems to 
work fine.  I assume that you had to define min2 and max2 previous in your 
exercise.  Maybe you could post those definitions as well as what the problem 
you're encountering is.
-- 
Irfon-Kim Ahmad
http://members.home.com/irfon/ahmadi/


_______________________________________________
Hugs-Users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/hugs-users

Reply via email to