Last active
September 21, 2018 15:30
Revisions
-
ChristopherDavenport revised this gist
Sep 21, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,7 +21,7 @@ object Foo { } def mapK[F[_], G[_]](foo: Foo[F])(f: F ~> G): Foo[G] = new Foo[G]{ def getFoo: G[Bar] = f(foo.getFoo) } def impl[F[_]](t: Transactor[F]): Foo[F] = connectIOTrait.mapK(_.transact(t)) } -
ChristopherDavenport revised this gist
Sep 21, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,7 @@ object Foo { implicit val metaBar: Meta[Bar] = Meta[Int].imap(Bar(_), _.x) } // For Metadata Testing private[Foo] val getBar : Query0[Bar] = sql"SELECT 1".query[Bar] private def connectIOTrait: Foo[ConnectionIO] = new Foo[ConnectionIO]{ def getFoo: ConnectionIO[Bar] = getBar.unique -
ChristopherDavenport revised this gist
Sep 21, 2018 . 1 changed file with 6 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,19 +5,19 @@ import doobie.implicits._ // Something for FunctionK ~> trait Foo[F[_]]{ def getFoo: F[Bar] } object Foo { case class Bar(x: Int) object Bar { implicit val metaBar: Meta[Bar] = Meta[Int].imap(Bar(_), _.x) } // For Metadata Testing private[Foo] val getBar : Query0[MyFoo] = sql"SELECT 1".query[Bar] private def connectIOTrait: Foo[ConnectionIO] = new Foo[ConnectionIO]{ def getFoo: ConnectionIO[Bar] = getBar.unique } def mapK[F[_], G[_]](foo: Foo[F])(f: F ~> G): Foo[G] = new Foo[G]{ -
ChristopherDavenport created this gist
Sep 21, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ import doobie._ import doobie.implicits._ // Something for FunctionK ~> trait Foo[F[_]]{ def getFoo: F[MyFoo] } object Foo { case class MyFoo(x: Int) object MyFoo { implicit val metaFoo: Meta[MyFoo] = Meta[Int].imap(MyFoo(_), _.x) } // For Metadata Testing private[Foo] val getMyFoo : Query0[MyFoo] = sql"SELECT 1".query[MyFoo] private def connectIOTrait: Foo[ConnectionIO] = new Foo[ConnectionIO]{ def getFoo: ConnectionIO[MyFoo] = getMyFoo.unique } def mapK[F[_], G[_]](foo: Foo[F])(f: F ~> G): Foo[G] = new Foo[G]{ def getFoo: G[Foo] = f(foo.getFoo) } def impl[F[_]](t: Transactor[F]): Foo[F] = connectIOTrait.mapK(_.transact(t)) }