-
Notifications
You must be signed in to change notification settings - Fork 450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unit return types #1386
Comments
I'd suggest reaching out to twitter to see if someone is interested in owning this space. |
@Tylos will tackle this during next quarter. |
Opening PR to document how to disable the check for IDEA Ktlint is still pending until certain rules can be disabled. It is currently in PR - pinterest/ktlint#503 Should it be moved to a separated issue @JorgeCastilloPrz ? |
Yep it'd be nice if we can add an issue for it then create a Marlow goal. As soon as support for disabling global rules is released to ktlint it'll be an easy one to tackle. |
When you're writing code in an FP manner, you want to keep all effects under control. Functions that return
Unit
are effectful by definition, since otherwise they'd do nothing. On their bodies, they always access the external world, as in printing, logging, network queries, database reads / writes, modifying the value of class properties... etc.Action points
Apart from the IntellIJ IDEA Inspection, Ktlint also complaints about Unit return types regardless of where they're used. That's also something we could suggest users how to disable on their ktlint configurations, since from an FP perspective it's always important to declare return types regardless of what they are, so it's explicit that the function has side effects inside.The text was updated successfully, but these errors were encountered: