1
Well, I had to do a function that, given a list and a number, returns the element from the list that is in that position (the number).
Basically it is the function already defined. The problem is that I have to restrict the function in case the number given is higher than the existing positions.
I tried for a where
but it gives error. I can put this where
? If not, in what situations can I use where
?
localiza:: [a]->Int->a
localiza [a] 0 = a
localiza (a:as) b = localiza (as) (b-1)
where b+1<=length(a)
of this error: parse error on input `Where'
what would be this function that is already defined?
– V.Avancini