-
Notifications
You must be signed in to change notification settings - Fork 3
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
Move around some stuff in core._ #2313
base: master
Are you sure you want to change the base?
Conversation
(A couple of FIXMEs as a nice break from bugs :P)
def ifElse[A](condition: Boolean, ifBranch: ⇒ DbResultT[A], elseBranch: ⇒ DbResultT[A]) = | ||
if (condition) ifBranch else elseBranch | ||
|
||
def doOrMeh(condition: Boolean, action: ⇒ DbResultT[_])(implicit ec: EC): DbResultT[Unit] = | ||
if (condition) action.meh else DbResultT.unit | ||
def when[F[_]](p: Boolean, s: ⇒ F[Unit])(implicit F: Applicative[F]): F[Unit] = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -276,15 +270,12 @@ package object db { | |||
def appendForUpdate[A, B <: slick.dbio.NoStream](sql: SqlAction[A, B, Effect.Read]): DBIO[A] = | |||
sql.overrideStatements(sql.statements.map(_ + " for update")) | |||
|
|||
def lift[A](value: A): DBIO[A] = DBIO.successful(value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed, we have pure from cats.
def apply[A](a: A)(implicit F: Monad[F]): FoxyT[F, A] = // TODO: remove me? @michalrus | ||
pure(a) | ||
|
||
def pure[A](a: A)(implicit F: Monad[F]): FoxyT[F, A] = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed, we have pure from cats.
@@ -105,20 +105,14 @@ package object db { | |||
} | |||
|
|||
trait FoxyTFunctions[F[_]] { | |||
def apply[A](a: A)(implicit F: Monad[F]): FoxyT[F, A] = // TODO: remove me? @michalrus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dead code.
FMT! |
Yikes! |
ddf83a5
to
a2bacc5
Compare
a2bacc5
to
fd29f48
Compare
@@ -18,7 +19,7 @@ object DiscountValidator { | |||
def validate(fs: FormAndShadow)(implicit ec: EC): DbResultT[Unit] = | |||
for { | |||
failures ← * <~ IlluminateAlgorithm.validateAttributes(fs.form.attributes, fs.shadow.attributes) | |||
_ ← * <~ failIfFailures(failures) | |||
_ ← * <~ failIfFailures[DBIO](failures) // TODO: why no inference? @michalrus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kjanosz sad :(
(A couple of FIXMEs as a nice break from bugs :P)