I’m having a problem with getting and dropping the first value from list in the recursive function.
Here is the code:
removeDuplicates a u = [if a == [] then u else removeDuplicates newA newU
| let newU = (head a):u
| let newA = tail a]
And error:
Illegal parallel list comprehension: use -XParallelListComp
And another idea:
removeDuplicates a u = [if a == [] then u else removeDuplicates (tail a) newU
| let newU = (head a):u]
And another error:
Occurs check: cannot construct the infinite type: a0 = [a0]
Expected type: [a0]
Actual type: [[a0]]
In the return type of a call of `removeDuplicates'
In the expression: removeDuplicates (tail a) newU
Thanks in advance.
Edit: At the moment only thing I’m trying to do with this function is moving all items from first list to second with recursive function one by one. After that I will add few more things to remove duplicate values from list.
It looks like you’re trying to do:
But this is basically
reverse: