<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/allow-lists-member-2-in-guard-clause-when-list-is-a-literal-list-gvneyicbx" -->

---
title: Allow lists:member/2 in guard clause when List is a...
description: A proposal on the Erlang Forums suggests extending Erlang guard clauses to allow lists:member/2 (or a new erlang:is_list_member/2) when the list argument is a...
canonical: https://daily.dev/posts/allow-lists-member-2-in-guard-clause-when-list-is-a-literal-list-gvneyicbx
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Allow lists:member/2 in guard clause when List is a literal list | daily.dev
og:description: A proposal on the Erlang Forums suggests extending Erlang guard clauses to allow lists:member/2 (or a new erlang:is_list_member/2) when the list argument is a...
og:url: https://daily.dev/posts/allow-lists-member-2-in-guard-clause-when-list-is-a-literal-list-gvneyicbx
og:image: https://api.daily.dev/og/posts/gvNEyiCbx.png
og:image:alt: Allow lists:member/2 in guard clause when List is a literal list
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Allow lists:member/2 in guard clause when List is a literal list

**[Erlang Forums](https://daily.dev/sources/erlangforums)** · 1 min read · 0 upvotes · 0 comments

## Summary

A proposal on the Erlang Forums suggests extending Erlang guard clauses to allow lists:member/2 (or a new erlang:is_list_member/2) when the list argument is a compile-time literal, similar to existing guard-safe functions like is_integer/1. The motivation is to simplify pattern matching against a fixed set of known values, replacing verbose chains of orelse Key =:= const comparisons or repetitive function clause overloads. The proposal includes a code example showing how the syntax could be rewritten internally as a chain of =:= orelse comparisons at the AST/forms level, demonstrating that this transformation is technically feasible today via parse_transform, though considered hacky.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://erlangforums.com/t/allow-lists-member-2-in-guard-clause-when-list-is-a-literal-list/5925>

## Similar posts on daily.dev

- [Erlang/OTP Proposals / Proposals: Ideas](https://daily.dev/posts/erlang-otp-proposals-proposals-ideas-sfj9ocegf) · Erlang Forums · 0 upvotes · 0 comments
- [Guards\! Guards\!](https://daily.dev/posts/guards-guards--tgwz4cct7) · Beam Bloggers Webring · 0 upvotes · 0 comments
- [On \`or\` and \`and\` operator deprecation](https://daily.dev/posts/on-or-and-and-operator-deprecation-egzxg8jhj) · Erlang Forums · 0 upvotes · 0 comments
- [Optimize Erlang comparisons or expose erlang:compare/2](https://daily.dev/posts/optimize-erlang-comparisons-or-expose-erlang-compare-2-hisf0shp7) · Erlang Forums · 0 upvotes · 0 comments
- [Erlang/OTP Proposals / Proposals: Ideas](https://daily.dev/posts/erlang-otp-proposals-proposals-ideas-qskzdneey) · Erlang Forums · 2 upvotes · 0 comments

---

Tags: [#compiler](https://daily.dev/tags/compiler), [#erlang](https://daily.dev/tags/erlang)

[View this post on daily.dev](https://daily.dev/posts/allow-lists-member-2-in-guard-clause-when-list-is-a-literal-list-gvneyicbx)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Allow lists:member/2 in guard clause when List is a literal list","url":"https://daily.dev/posts/allow-lists-member-2-in-guard-clause-when-list-is-a-literal-list-gvneyicbx","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/allow-lists-member-2-in-guard-clause-when-list-is-a-literal-list-gvneyicbx"},"datePublished":"2026-09-03T12:35:06.067Z","dateModified":"2026-09-03T13:09:27.101Z","description":"A proposal on the Erlang Forums suggests extending Erlang guard clauses to allow lists:member/2 (or a new erlang:is_list_member/2) when the list argument is a...","image":"https://media.daily.dev/image/upload/s--1KxV4ohY--/f_auto/v1722860400/public/Placeholder%2007","thumbnailUrl":"https://media.daily.dev/image/upload/s--1KxV4ohY--/f_auto/v1722860400/public/Placeholder%2007","isAccessibleForFree":true,"articleSection":"Erlang Forums","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Erlang Forums","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/b352c25bf0ad4af3b186d4cdf1c4f17c","url":"https://daily.dev/sources/erlangforums"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/allow-lists-member-2-in-guard-clause-when-list-is-a-literal-list-gvneyicbx","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"compiler,erlang","timeRequired":"PT1M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Erlang Forums","item":"https://daily.dev/sources/erlangforums"},{"@type":"ListItem","position":3,"name":"Allow lists:member/2 in guard clause when List is a literal list"}]}
```

