在 Haskell 中我该怎么写:
function :: (Int,Int) ....
function Not(0,0) otherparameters = []
即我有一个函数,除了第一个参数是元组 (0,0) 之外,我想为每种情况返回一个空列表
如何在 Haskell 中做到这一点?
我尝试过函数(不是(0,0))但收到以下错误
Parse error in pattern: not
非常感谢
先写异常模式:
function :: (Int,Int) ....
function (0,0) otherParameters = exceptionalResult
function _ _ = [] -- empty list in every other case