This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
elem' :: (Eq a) => a -> [a] -> Bool
elem' a [] - False
elem' a (x:xs)
| a == x = True
| otherwise = a `elem'` xs
So my question is regarding the head of the list (x:xs). What exactly happens to x in the otherwise case? Does it just get dumped from memory? Not sure if my question is making sense, perhaps there's a better way to phrase it. I'm just a newbie trying to learn the language. It all makes a lot of sense so far, but I feel it would clear up much confusion to understand what's going on with regards to the head x.
Subreddit
Post Details
- Posted
- 2 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/haskell/com...