Re: primes. Totally agree with Peter. One prime is kinda nice for a
temporary variable, but beyond that... you can add a short word to your
variable name, and then you won't have to do any counting!

Re: backticks.

Evan's explanation from elm-dev:

The backtick syntax is neat, but ultimately, it is redundant. In practice,
> it is recommended against in every case, with the one exception of andThen.


My take on this: Backticks are not needed because they are redundant with
the forward pipe operator.

The only situation where backticks are useful is when you are doing a
single function call, and "foo `function` bar" is easier to read than "function
foo bar". I haven't seen this crop up too many times. But if it does, "foo
|> function bar" is just as good.

If you are chaining together multiple function calls, backticks are a
disaster. The preferred way of writing functions in Elm is to put the
argument being "modified" last. That makes it easy to chain together
function with pipes. For example:

map : (a -> b) -> Maybe a -> Maybe b
something |> map multiplyByThree |> map toString |> map translateToSpanish

Functions that are designed this way can't be chained using backticks. On
the other hand, if you design a function to work with backticks, it is not
going to chain correctly with any of the other functions.

andThen : Maybe a -> (a -> Maybe b) -> Maybe b
something |> map multiplyByThree |> flip andThen actFlippantly

Because they are so rarely needed, better to remove backticks completely
and not have to worry about another `andThen` style API coming along!



On Tue, Oct 18, 2016 at 6:28 PM, mbr <[email protected]> wrote:

> just learned that primes and backticks won't be on elm 0.18.
>
> What are the reason for their removal?
>
> I will miss the primes quite a bit. Am I the only one here that feels this
> way ?
>
> For instance, I would have to write headerModel___ and headerModel__
> instead of headerModel''' and headerModel''
> In the prime case I count the 'while on the underscore case I will
> compare its length.
>
> at the end of the day, I will just skip the underscore and use number like
> headerModel03 and headerModel02.
>
> And my case for backticks, I understand it will make the andThen API
> easier, but why completely remove it from the language ?
>
> I guess my main question is, What is the motivation for their removal ?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to