driver-oss / driver-core

Multi-cloud utilities and service initialization framework.
Apache License 2.0
7 stars 3 forks source link

`customAction` overload is redundant #45

Open stewSquared opened 7 years ago

stewSquared commented 7 years ago

In the Dal trait, customAction is overloaded:

def customAction[R](action: => Future[R]): T[R]

and

def customAction[R](action: => OptionT[Future, R]): OptionT[T, R]

The latter is unnecessary, since you can just optionT.mapT(customAction). It's also detrimental because overloading interferes with type inference and cognitive load. I strongly encourage removing it or at the very least re-naming to something more semantically explicit.

stewSquared commented 7 years ago

See: https://stackoverflow.com/questions/2510108/why-avoid-method-overloading