Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Move around some stuff in core._ #2313

wants to merge 2 commits into from

Conversation

michalrus
Copy link
Contributor

(A couple of FIXMEs as a nice break from bugs :P)

(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] =
Copy link
Contributor Author

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)
Copy link
Contributor Author

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] =
Copy link
Contributor Author

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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dead code.

@narma
Copy link
Contributor

narma commented Jun 27, 2017

FMT!

@michalrus
Copy link
Contributor Author

Yikes!
But it wouldn’t compile anyway. :p

@@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kjanosz sad :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants