I've been trying out Elm, and although I have a little functional 
programming experience from F#, mostly I have used OO languages. With my 
experiments in Elm, I have found sometimes I end up with something like this

foofunction model = 
  let 
    something = foo bar baz
    somethingElse = foo bar baz
    yetMoreStuff = foo qux thud
  in
   { model 
      | fieldA = something
      , fieldB = somethingElse
      , fieldC = yetMoreStuff
    }


... anyway I hope you get the idea. A style of function which lot of lines 
in the 'let' block before generally one final thing in the 'in' block. In 
F#, this sort of thing didn't look so bad as the stuff in the let block 
would be all applied with individual 'let' functions. However in Elm they 
start to *resemble *OO/imperitive style variable assignments, which makes 
me question whether this is the Right Thing to do, or would it be 
considered stylistically better to do something else, like for eg chain the 
model through individual updating functions using '|>'.  Any strong 
opinions about this? Have not seen too much about it in the style guides 
etc that I have encountered

Andrew
 

-- 
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