Discussion: How much to pipeline

Another thing to think about … do you pipeline the first call in a chain?

Do you use |> only to avoid parens:

Dict.get "content-length" metadata.headers
    |> Maybe.andThen String.toInt
    |> Result.fromMaybe (BadHeader "Content-Length header not found or invalid")

Or do you go “all the way”?

metadata.headers
    |> Dict.get "content-length"
    |> Maybe.andThen String.toInt
    |> Result.fromMaybe (BadHeader "Content-Length header not found or invalid")
2 Likes