How would one define a function which interacts wi...
# arrow
j
How would one define a function which interacts with a database?
Copy code
fun findUserByUsername(username: String, con: Connection): IO<Either<Exception, Option<User>> {
	...
}
Or would you combine IO & Reader as in (Not sure about syntax)
Copy code
fun findUserByUsername(username: String): Reader<Context, IO<Either<Exception, Option<User>>> {
	...
}
Or would you keep it simple like this:
Copy code
fun findUserByUsername(username: String, con: Connection): Either<Exception, Option<User>> {
	...
}
Which one is the "best"?