How to return or break from an action early?

If you’re conditions are more of flat, then case with multiple match inside func or pattern match on func would be enough.

If your case is more complicated - such as 5 sequential validation and return in the middle of it - then use with or running multiple func as pipeline. Something like Plug. See this talk

1 Like