element ::Int->Int->[[Int]]-> Int
element z s m= m!!z!!s
maxIndex :: Int
maxIndex = 6
matrix :: [[Int]] -> Int -> Int -> Int -> Int
matrix a row column maxIndex = if maxIndex < length a then error "Out of range"
else if (row-1<0 || row-1>maxIndex)||(column-1<0 || column-1>maxIndex) then error "Out of range"
else element (row-1) (column-1) a
我在哪里犯错?我希望我的程序采用我的 maxIndex 常量,因此用户不必输入 maxIndex 的值?