Quantcast
Channel: data types in haskell programming - Stack Overflow
Browsing all 4 articles
Browse latest View live

Answer by lbolla for data types in haskell programming

You can easily (but not very efficiently), get a list of all the duplicates using nub and (\\).I presume this is a homework: this suggestion should give you a good starting point.

View Article



Answer by Ketil for data types in haskell programming

The key is, as so often, recursion.A list contains a duplicate if either:the first element has a duplicate in the rest of the list, orthe rest of the list contains a duplicateAdd to this that an empty...

View Article

Answer by luqui for data types in haskell programming

This code is a good start. The aux function you have already written searches to see if an element is in a list. Now you just need to check the first element against the rest of the list, and if that...

View Article

data types in haskell programming

It is a haskell code to find the first duplicate element in the list. if you have 2 lists like this:L1 = {1,2,3,4} L2 = {1,2,3,1}then result for 1st would be No duplicate found and result for second...

View Article
Browsing all 4 articles
Browse latest View live




Latest Images