The others are right that the problem is the :
operator. I would say that your areTheySame
function that returns a list is the wrong approach anyway, though. Rather than switch to the ++
operator, a better implementation of that function would be:
removeItem _ [] = [] removeItem x (y:ys) | x == y = removeItem x ys | otherwise = y : removeItem x ys
As you can see, this is a pretty simple implementation. Also, consing like this is much less taxing for your program than appending a bunch of lists together. It has other benefits as well, such as working lazily.
Related Posts:
- How do I append lists in Prolog?
- Inorder Binary Tree Traversal (using Python)
- How to have a set of sets in Python?
- How to obtain a subarray in python 3
- Reversing a List in Prolog
- List Length in Prolog
- Editing a Post, 99% CPU?
- Similar posts formatting
- Introductory paragraph only in list of blog posts
- List all categories in options
- WooCommerce Grid / List view
- custom walker wp menu last element
- How to divide and display categories into two columns
- To get list of bottom most or deepest or last child for specified parent category
- List first letter of categories – issue upon spcecial characters (danish letters)
- How do I create an alphabetically organized glossary of links?
- Generate a nested list of all posts, sorted first by year, then by month
- adding a #hash to each link in list_pages()?
- How correct list-style displayed in firefox? [closed]
- Output categories in something different than a list
- Wrap Meta Box with and for each new line
- get_all_category_ids for bookmark
- Add thumbnails in ‘li’ list
- List child pages alphabetically
- How to make a text string into a bullet list [closed]
- How to overcome TypeError: unhashable type: ‘list’
- Difference between Arrays.asList(array) and new ArrayList
(Arrays.asList(array)) - Accessing the index in ‘for’ loops?
- TypeError: list indices must be integers or slices, not list
- Is there a short contains function for lists?
- appending list but error ‘NoneType’ object has no attribute ‘append’
- Check if something is (not) in a list in Python
- Convert Set to List without creating new List
- TypeError: ‘list’ object cannot be interpreted as an integer
- Finding and replacing elements in a list
- ValueError: max() arg is an empty sequence
- finding the maximum length of lists in c#
- Append integer to beginning of list in Python
- List comprehension on a nested list?
- Union of two lists in Python
- How can I find a specific element in a List
? - What’s the idiomatic syntax for prepending to a short python list?
- Converting Dictionary to List?
- How to deep copy a list?
- How do I check if a list is empty?
- IndexError: list index out of range and python
- How to initialize List
object in Java? - Pop index out of range
- How to iterate through two lists in parallel?
- How to remove \n from a list element?
- How to print out all the elements of a List in Java?
- Type List vs type ArrayList in Java
- Append a tuple to a list – what’s the difference between two ways?
- Defining lists as global variables in Python
- Are 2 dimensional Lists possible in c#?
- How to easily initialize a list of Tuples?
- HashSet vs. List performance
- Python data structure sort list alphabetically
- TypeError: unsupported format string passed to list.__format__
- How to split() a delimited string to a List
- Why is the minimalist, example Haskell quicksort not a “true” quicksort?
- How to create a numpy array of lists?
- How do I use the filter function in Haskell?
- Determine if 2 lists have the same elements, regardless of order? [duplicate]
- Building a list inside a list in python
- What does the “Just” syntax mean in Haskell?
- How to split a string in Haskell?
- Removing default image size list in Media Box
- List latest posts in WP-Admin
- How to put last edited entry on top of the blog-post list?
- Display only one result from “get_the_category_list”
- TinyMCE – Add class to OL – selector doesn’t seem to get parent OL,UL, just LI’s (4.6.3)
- How to find the number of Tags a post has?
- wordpress wp_list_categories
- WordPress’ visual editor messing up my (nested) lists (and other things as well)
- wp alchemy multiple image uploader output images to template
- Displaying terms by first letter
- Adding (blog-specific) links to “My Sites” admin page
- Display the last post by each category?
- Show certain posts in a LIST format that members have been granted access to
- List all categories with featured image from post?
- Authors list Pagination : result set from $wpdb->get_results()
- Is a list page usually called an archive page in WordPress?
- how to wordpress When I click on the category link, subcategories appear
- new WP_Query all post in a category inside the loop
- Hide specific category from wp_list_categories
- How do I add a separator to my list of terms with get_category
- How do i wrap woocomerce attribute in list?
- display widget checkbox selection on frontend
- How to use numbered lists in the post editor?
- Efficient way to fetch all archived WPMS blogs
- wp_nav_menu: output featured image of each page listing
- Highlighting Current Category in the Archive and Feeds page
- How can i filter wordpress users by custom feild?
- How do you obtain a list of all image file names on a wordpress website for replacement?
- How to let users create lists of woocommerce products?
- put a list of one post type in other post type to select from it and display selected item in second post type’s single page
- Last three posts not being put in order by date. How to fix this?
- How to Create a Frontend Html-list Editable in the Backend?
- List all sites in multisite