scala programming

If there is a single canonical value for a particular type, we can make that value available to the compiler by marking it as given.

val theme = Theme("Dark")
given Theme = theme

So, whenever compiler gets contextual parameter of type Theme in the scope, it refers to theme.

renderDialog("Hello")

This call is enough and we don’t have to pass theme to renderDialog.