Here is the module – Number1.hs
module Number1(isTriangle) where
isTriangle x y z = if x*x+y*y >= z*z then True
else False
This is the main program Main1.hs
import System.Environment
import Number1
main = do
args<-getArgs
let a = args !! 0
let b = args !! 1
let c = args !! 2
if (IsTriangle a b c) then return(True)
else return(False)
This error I get when ghc --make Main1.hs
When you call
isTrianglein Main1.hs, you call it with a capital ‘I’.Make sure your capitalisation matches as Haskell is case sensitive, and make sure functions start with a lower case character as this is mandatory.
Edit – rounding up other errors
Main1.hs:
Number1.hs: