Implement a function, that takes two numbers and return them in Ascending Order.
Sample.hs
type MinMax = (Integer, Integer)
getMinMax :: Integer -> Integer -> MinMax
getMinMax x y = if (x then (x, y) else (y, x)
Prelude> :load Sample.hs
[1 of 1] Compiling Main ( Sample.hs, interpreted )
Ok, modules loaded: Main.
*Main>
*Main> getMinMax 10 20
(10,20)
*Main> getMinMax 20 10
(10,20)
*Main> getMinMax 10 10
(10,10)
*Main>
This post first appeared on Java Tutorial : Blog To Learn Java Programming, please read the originial post: here