# Record creation shortcut

**URL:** <https://discourse.elm-lang.org/t/record-creation-shortcut/6136>\
**Category:** Request Feedback\
**Created:** [August 6, 2020, 3:08pm UTC](https://discourse.elm-lang.org/t/record-creation-shortcut/6136 "2020-08-06T15:08:36Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![ChrisWellsWood](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/chriswellswood/32/5293_2.png) [@ChrisWellsWood](https://discourse.elm-lang.org/u/ChrisWellsWood)\
**Post date:** [August 7, 2020, 12:26pm UTC](https://discourse.elm-lang.org/t/record-creation-shortcut/6136/21 "2020-08-07T12:26:35Z")

</div>

> [@jfmengels](#):
>
> Don’t confuse destructuring with the destructuring assignment:

Wouldn’t something like this be de-structuring without assignment?:

```auto
case list of
    ["hello"] -> ...

```

Surely this:

```auto
const foo = ({a, b}) => a + b

```

counts as assignment as `a` and `b` are being assigned in the function body. Regardless, I think we understand each other.

Thanks to everyone that’s contributed so far, it’s interesting to get other perspectives on this and it’s clear that it’s a lot more contentious than I initially thought it would be!

---

<div class="post-metadata">

**Author:** ![francescortiz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/francescortiz/32/1721_2.png) [@francescortiz](https://discourse.elm-lang.org/u/francescortiz)\
**Post date:** [August 7, 2020, 1:28pm UTC](https://discourse.elm-lang.org/t/record-creation-shortcut/6136/22 "2020-08-07T13:28:43Z")

</div>

Sorry that I dodn’t answer to everything. As you say, the topic is not trivial, I want to clarify more the context of my statement. In this example:

> [@ChrisWellsWood](#):
>
> ```auto
> myFunc : Option -> { x : Float, y : float } -> Float
> myFunc option { x, y } = -- assignment
> case option of
> MultiplyBy scalar -> -- assignment
> x * y * scalar
> Double ->
> let
> scalar = 2 -- assignment
> in
> x * y * 2
> 
> ```

only the third case is introducing a new value. In the two first cases the value is defined somewhere else. I was thinking more about answering to questions like “where is this value set/calculated”? But you are right, it is not a golden rule, but it helps a lot having a uniform language.

Having a uniform language is a super hard to beat argument. I have read a lot of code in the last 30 years. When languages are very flexible projects easily ends up becoming DSL. On the other hand, if the language is super uniform, it is closer to behaving as a Framework, where all projects tend to use the same structure and patterns. I think that Elm fits much better this second case, and that is one of its strengths.

But, again, these are my thoughts. Regards!

---

<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:** [August 17, 2020, 1:28pm UTC](https://discourse.elm-lang.org/t/record-creation-shortcut/6136/23 "2020-08-17T13:28:52Z")

</div>

Closed on August 17, 2020, 1:28pm UTC

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

[Previous page](https://discourse.elm-lang.org/t/record-creation-shortcut/6136.md?page=1)
