I'm writing a function that takes an input a list, creates sublists, and retrieves n elements that it outputs into a new list. I'm writing guards depending on the value of the inputs, but I keep getting the error "Patterns not matched: (:) _".
Anyone identifies the issue?
nKsets :: [Int] -> Int -> [[Int]]
nKsets [] _ = error "Empty list should not be given as input"
nKsets l n
| n <= 0 = []
| n > 0 = ...
The error I'm getting is:
Pattern match(es) are non-exhaustive
In an equation for ‘nKsets’: Patterns not matched: (_:_) _