TL;DR: when do you mostly use
List.append—inline or in chains of forward pipes? Does
prepend make more sense in your head?
Because Elm “uses the convention that the data structure is always the last argument”, I often read functions as
I’m sure this is far from novel, and is possible for (I think) the same sort of reasons that make chaining with forward pipes so readable (start with this list, then do this to it, then do this to it). But that’s exactly why I always find
String.append strange. I always want to read it as
that, where I “should” be reading it as
that. But in my head,
append should be called
prepend. Does anybody else feel this way?
I guess it comes down to where
String.append are most commonly used? If it’s mostly used inline, I can see why
append [1, 2] [3, 4] makes sense. But if it’s mostly used in forward pipes (as I think I do), wouldn’t it make more sense to write the following?
myString |> String.replace " " "-" |> String.toLower |> String.prepend "Username: "
P.S. I’ve tried to find out if anybody else has brought this up in Slack or Discourse and can’t find anything, so maybe it is just me!