I\'d like to write a function that checks if one list is a sublist of another list. I wrote this, but it is not working, but I need something like this, I guess. Thanks for
You could use the function intersect like this:
intersect [list1] [list2] == [list1]
*Test> intersect [] [] == []
True
*Test> intersect [1] [] == [1]
False
*Test> intersect [2,4,6,4] [9,5,4,2,6,3,3] == [2,4,6,4]
True
*Test> intersect [1,2,3] [3,2,5,4] == [1,2,3]
False
You will have to import Data.List for this.