I am totally new in Haskell and when writing small programs i normally end up with too many where clauses to check many things in the function, so it is good practice to write where clauses or is there any other good alternatives for this ?
for example in the code below i tried to find if there is ant duplicate elements in each row of the two dimensional list, it works and every thing is content in same function but i am not satisfied with how code looks and i find it more imperative style of approaching to the problem so i am looking for any suggestion or thought on this from the experienced people out there.
noDups :: [[a]] -> Bool
noDups du = and (checkSu du)
where
checkDup [] = []
checkDup (x:xs) = checkRow x ++ checkDup xs
where
checkRow [] = []
checkRow (x:xs) = [x /= y | y <- xs] ++ checkRow xs
once again this code is just to illustrate one problem, i am looking for approach to formulate problem in functional style. your suggestions or articles, links would be much helpful.
Thanks