I need to construct an auxiliar function in Haskell that, for example: let’s $A$ be a matrix:
returns me a boolean if there is, at least, a triple tens list that are diagonal, thus:
*Main> ((10,2,3,4),(5,10,10,8),(9,10,10,12),(10,14,15,16)) result: True
This code calculates the main diagonal of a matrix:
diagonal :: ((Int)) -> (Int) diagonal () = () diagonal (x:xs) = head x : diagonal (map tail xs)
but i need to solve it for any diagonal and no necessarily for square matrix.
I don’t have a lot of experience with Haskell. Any help would be appreciated.