It is not the first time I have this usecase, where I want more than two arguments for minOf.
minOf currently supports XInt/YInt and XAxisSolver/YAxisSolver (but only 2 args for both kinds)...
I have just ran into another case with the latter. The layout is like this:
TITLE
PRIMARY_ACTION (optional, maybe GONE)
SECONDARY_ACTION (optional, maybe GONE)
---screen-bottom---
I want to do something like this:
titleView.layoutBy(
x = matchParentX(),
y = minOf(
bottomTo { primaryAction.top() - 16.ydip },
bottomTo { secondaryAction.top() - 16.ydip },
bottomTo { parent.bottom() - 16.ydip },
)
)
but minOf has only 2 args... Similar situation is for xint/yint, I often find myself wishing for more args.
Is this possible or maybe I also miss some easy workaround to achive what I want? I know I can put if (someView.isVisible) rule1 else rule2 in my lambdas, but that looks not very elegant and a bit messy...
P.S. Can't help but think that if we'd be in the functional programming land, XInt/Yint, and axis solvers could be an instance of Monoid + Ord and all the stdlib functions (including min) would just work on them. But oh well :)