Ah, actually one more thought, I don’t remember whether it was considered
in the original discussion:

The situation of where vs. let is a bit different in Elm than in Haskell
via the point that Elm does not allow multiple equations for a function.
Concretely, in Haskell one can have:

f (Leaf x) = some expression
  where ... some local definitions involving x ...f (Node s t) = some
other expresion
  where ... some local definitions involving s and t ...

That’s easy to translate into an Elm form

f tree =
  case tree of
     Leaf x -> ...
     Node s t -> ...

if one may use let-bindings in the branches.

But if Elm only had where, and it would work like in Haskell, what would
you do? Because the following is not legal in Haskell:

f tree =
  case tree of
    Leaf x -> some expression
      where ... some local definitions involving x ...
    Node s t -> some other expression
      where ... some local definitions involving s and t ...

​

2016-12-31 23:46 GMT+01:00 Colin Woodbury <coli...@gmail.com>:

> > it is counterproductive to not up front discuss the actual alternatives
>
> While I think `let` is always an anti-pattern, I don't think it needs to
> be removed if there is support for it. The "there must only be one way"
> argument is moot so long so long as the points raised above are left
> unaddressed. In general, I think that that philosophy remains an ideal
> detached from the reality of programming (and the mathematics behind it).
>
> > And I don’t think that lambda + let was refuted.
>
> I will have to dig back into those refactoring examples and see what was
> missed, if anything.
>
> > Make an experiment...
>
> Haha I suppose your 20 years beats my 5. That said, I'd never give up
> `where`, but also never do local binds in lambdas. I like the idea of that
> experiment, and will put it together tomorrow, posting the questions here
> beforehand to make sure they're fair. A google poll posted across IRC,
> Reddit, and Twitter ought to be representative. Can I trust that the
> results will be respected, at least within the scope of this debate? It's
> been made abundantly clear that Haskellers aren't the target audience for
> Elm.
>
> --
> 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 elm-discuss+unsubscr...@googlegroups.com.
> 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 elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to