4 ms·
Since the type is inferred, why can't the module name by convention be inferred from the data type in pipe operations? So instead of: ["a", "b", "c"] |> List.
by redbar0n 3y ago
Since the type is inferred, why can't the module name by convention be inferred from the data type in pipe operations?
So instead of:
["a", "b", "c"]
|> List.append "d"
|> List.append "e"
|> List.append "f"
You could have:
["a", "b", "c"]
|> append "d"
|> append "e"
|> append "f"
Since Roc knows that the type returned from each function is a List.
- bhansconnect 3y agoRoc cares a lot about explicitness, so I don't think this would be a wanted feature. That said, it is easy to get this functionality with something like ``` append = List.append ``` An important note is that any module could expose an append function that has the same interfaces as `List.append`, so that could easily lead to confusion.