I am used from writing in other functional languages, to use where-statements for the internal details of a function. It makes for readable code, because a function will then end up reading like a ‘tree’: The most important high-level statement(s) are first, with explanations of the different parts of this high-level statement being explained in the following lines.
However, while Elm has support for let statements, which allow you to specify details before writing a statement, the language does not support where-statements.
I expect this was done for a reason, and I’d love to understand the reasoning behind supporting let rather than where.
That decision would go back a long way. I think it was part of Elm’s deliberately minimalist approach not to have two things that are equivalent. I’m sure I saw a conversation about it on the old elm-dev mailing list somewhere, you might try searching it. https://groups.google.com/forum/m/#!forum/elm-dev
I have unfortunately not been able to find it so far; probably because both let and where are such common words in normal english sentences. If anyone is able to find or remember this conversation, I’d be much obliged!
Indeed, this is what I expect as well, but (at least to me) it feels odd to pick let rather than where, because of the readability of hierarchically structured code.
Then again, of course this discussion, while being interesting, will definitely not have a change on what Elm supports today, since keeping features minimal is something to continue striving for (since adding something to a language is so much easier to removing something).
@Duncan Interesting idea, although I am a bit scared of being lynched by anyone who ends up reading my code .