# Does the guide ever explain \`let\`?

**URL:** <https://discourse.elm-lang.org/t/does-the-guide-ever-explain-let/10509>\
**Category:** Learn\
**Created:** [December 18, 2025, 8:18pm UTC](https://discourse.elm-lang.org/t/does-the-guide-ever-explain-let/10509 "2025-12-18T20:18:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![adamyakes](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/adamyakes/32/4385_2.png) [@adamyakes](https://discourse.elm-lang.org/u/adamyakes)\
**Post date:** [December 18, 2025, 8:18pm UTC](https://discourse.elm-lang.org/t/does-the-guide-ever-explain-let/10509/1 "2025-12-18T20:18:04Z")

</div>

Someone on my team asked a syntax question about `let` and I wanted to point them to the guide, but I searched through and I actually can’t find a single reference to it. This seems like a pretty big gap to me, i.e. “How to create local variables?” is just not mentioned.

[Time · An Introduction to Elm](https://guide.elm-lang.org/effects/time) has an example _using_ a `let`, but that’s it.

Similarly, the fact that variables must be lowercase wasn’t mentioned outside the context of _type_ variables. I couldn’t find a reference to types being capitalized either.

I believe the official guide is very good, but did I just miss it? I wouldn’t think this was intentional. If it wasn’t intentional, I would be glad to contribute some language as a starting off point.

---

<div class="post-metadata">

**Author:** ![lydell](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/lydell/32/178_2.png) [@lydell](https://discourse.elm-lang.org/u/lydell)\
**Post date:** [December 18, 2025, 9:31pm UTC](https://discourse.elm-lang.org/t/does-the-guide-ever-explain-let/10509/2 "2025-12-18T21:31:04Z")

</div>

(This is not the guide, but just noting that it’s mentioned here (though it does not mention lower and upper case): [docs/syntax](https://elm-lang.org/docs/syntax#let-expressions))

---

<div class="post-metadata">

**Author:** ![rupert](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/rupert/32/1775_2.png) [@rupert](https://discourse.elm-lang.org/u/rupert)\
**Post date:** [December 18, 2025, 9:59pm UTC](https://discourse.elm-lang.org/t/does-the-guide-ever-explain-let/10509/3 "2025-12-18T21:59:14Z")

</div>

A piece of Elm syntax that exists that does not sem to be documented anywhere is `as`:

```auto
type Id = Id String

someFun (Id val) as id =
   ...

```

Gives you both `val : String` and `id : Id` as args in your function.

---

<div class="post-metadata">

**Author:** ![lydell](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/lydell/32/178_2.png) [@lydell](https://discourse.elm-lang.org/u/lydell)\
**Post date:** [December 19, 2025, 11:00am UTC](https://discourse.elm-lang.org/t/does-the-guide-ever-explain-let/10509/4 "2025-12-19T11:00:44Z")

</div>

(The correct syntax is `someFun (Id val as id) =`, though.)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/elm_lang/original/1X/50a05e53677a2c3b47776d7abd0f113eb50193a1.png) [@system](https://discourse.elm-lang.org/u/system)\
**Post date:** [December 29, 2025, 11:01am UTC](https://discourse.elm-lang.org/t/does-the-guide-ever-explain-let/10509/5 "2025-12-29T11:01:00Z")

</div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
