Two module Up.hs and Down.hs
module Up (isSortedUp) where
isSortedUp x y z = if x>y && y>z then return(True) else return(False)
module Down (isSortedDown) where
isSortedDown x y z = if x<y && y<z then return(True) else return(False)
And the main program Main.hs
import System.Environment
import Up
import Down
main = do
args<-getArgs
let a = read(args !! 0)
let b = read(args !! 1)
let c = read(args !! 2)
if (isSortedUp a b c || isSortedDown a b c)
then putStrLn "True"
else putStrLn "False"
During compilation I get the following error:
Couldn't match expected type `Bool' with actual type `m0 Bool'
In the return type of a call of `isSortedUp'
In the first argument of `(||)', namely `isSortedUp a b c '
In the expression: (isSortedUp a b c || isSortedDown a b c)