checkSignatures :: Program a b c NodeMeta -> ErrorOr ()
checkSignatures = mapMSignatures_ checkSignature
  where checkSignature Signature{ sigName = "main", args = [], retType = T.Integer } = return ()
        checkSignature s@Signature{ sigName = "main", args = [], retType = t }       = invalidMainRetType t (signaturePos s)
        checkSignature s@Signature{ sigName = "main", args = a }                     = invalidMainArgs (map varType a) (signaturePos s)
        checkSignature Signature{..}                                                 = checkArgs args $ functionOrMethod isPure sigName
checkSignatures :: Program a b c NodeMeta -> ErrorOr ()
checkSignatures = mapMSignatures_ checkSignature
  where checkSignature Signature{ sigName = "main", args = [], retType = T.Integer } = return ()
        checkSignature s@Signature{ sigName = "main", args = [], retType = t }       = invalidMainRetType t (signaturePos s)
        checkSignature s@Signature{ sigName = "main", args = a }                     = invalidMainArgs (map varType a) (signaturePos s)
        checkSignature Signature{..}                                                 = checkArgs args $ functionOrMethod isPure sigName
checkSignatures = mapMSignatures_ checkSignature
  where checkSignature Signature{ sigName = "main", args = [], retType = T.Integer } = return ()
        checkSignature s@Signature{ sigName = "main", args = [], retType = t }       = invalidMainRetType t (signaturePos s)
        checkSignature s@Signature{ sigName = "main", args = a }                     = invalidMainArgs (map varType a) (signaturePos s)
        checkSignature Signature{..}                                                 = checkArgs args $ functionOrMethod isPure sigName