|
|
|
|
|
by karmajunkie
860 days ago
|
|
`with` is more widely used, i think, but there's also `Kernel.then/2`: data
|> call_service
|> then(fn {:ok, decode} -> decode_file(decode) end)
|> then(fn {:ok, file} -> store_file(file) end)
your solution also works if you define the function headers with a pattern match against the tuple, but then you have this extra function hanging around. Feels like a style thing more than anything else. |
|