Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 02 12:12
    Fristi closed #26
  • Jul 17 2018 13:59

    kailuowang on master

    Update README.md (compare)

  • Jul 13 2018 18:57

    kailuowang on master

    updated readme (compare)

  • Jul 13 2018 18:56

    kailuowang on gh-pages

    updated site (compare)

  • Jul 13 2018 17:55

    kailuowang on v0.6.4

    (compare)

  • Jul 13 2018 17:55

    kailuowang on master

    Setting version to 0.6.4 Setting version to 0.6.5-SNAPSH… (compare)

  • Jul 13 2018 16:15
    codecov[bot] commented #41
  • Jul 13 2018 16:15
    codecov[bot] commented #41
  • Jul 13 2018 16:12

    kailuowang on master

    added `autoApplyK` macro (#41) … (compare)

  • Jul 13 2018 16:12
    kailuowang closed #41
  • Jul 13 2018 16:02
    codecov[bot] commented #41
  • Jul 13 2018 16:02
    kailuowang synchronize #41
  • Jul 13 2018 16:02

    kailuowang on autoApplyK

    fix build and feedback (compare)

  • Jul 13 2018 14:33
    LukaJCB commented #41
  • Jul 13 2018 14:19
    kailuowang opened #41
  • Jul 13 2018 14:19

    kailuowang on autoApplyK

    refactor added autoApplyK (compare)

  • Jul 11 2018 02:55

    kailuowang on master

    Add autoFlatMap (#36) * Unifie… (compare)

  • Jul 11 2018 02:55
    kailuowang closed #36
  • Jul 11 2018 02:53
    kailuowang commented #36
  • Jul 10 2018 22:54
    Jentsch commented #36
Edmund Noble
@edmundnoble
We're removing MonadTrans in 1.0, but cats-mtl will have an equivalent. I think interop with cats-mtl will likely be very useful for mainecoon.
Mark de Jong
@Fristi
Created a issue @kailuowang
@edmundnoble I see, cats-mtl looks promising any ETA on first release :) ?
Edmund Noble
@edmundnoble
I'm looking at a week and a half
Mark de Jong
@Fristi
Is there any work done on mocking finally tagless algebra's ? Like in smock https://github.com/djspiewak/smock or https://github.com/slamdata/purescript-mockfree
Edmund Noble
@edmundnoble
Afaik you need to use writer over the initial algebra
Given that, I think we could adapt something like smock
Mark de Jong
@Fristi
To verify calls etc, but you need a total implementation in the end I guess? That's also the case for smock right?
Yea tried playing around with some concepts, but I didn't got that far yet :)
wedens
@wedens
Are you sure you need mocking?
And not just some kind of in-memory db with predefined data or something
Mark de Jong
@Fristi
That's what I was also thinking about, but with mocking you can target specific methods to be mocked and don't implement the rest, because you want to test a specific case. I think it would be tedious to implement a interpreter for each test case right? :) Or do you approach this differently?
wedens
@wedens
hm. "mapK is not a member" error in a simple algebra with additional type parameter @autoFunctorK @finalAlg trait Alg[F[_], A] { def f(a: A): F[Unit] } (simplified example)
ok.Alg.mapK does work (I think it's worth mentioning in a FAQ section on extra type parameters).
Kai(luo) Wang
@kailuowang
I think it’s probably FunctorK syntax not working with PartialUnification unifying from the right.
 trait AlgWithExtraTP2[T, F[_]] {
    def a(i: Int): F[T]
  }

 implicit val algWithExtraTP: AlgWithExtraTP2[String, Try] = new AlgWithExtraTP2[String, Try] {
      def a(i: Int) = Try(i.toString)
  }
 algWithExtraTP.mapK(fk).a(5) should be(Some("5"))
so you could use Alg.mapK, or I wonder if FunctorK[Alg[?[_], A]].mapK would work.
Odomontois
@Odomontois
HI guys
Kai(luo) Wang
@kailuowang
Hi
Odomontois
@Odomontois

What could be possible reasons for

macro annotation could not be expanded (the most common reason for that is that you need to enable the macro paradise plugin; another possibility is that you try to use macro annotation in the same compilation run that defines it)

except mentioned two ?

Kai(luo) Wang
@kailuowang
Most likely You need the sbt settings suggested in the readme.
Odomontois
@Odomontois
I probably forgot to add scalameta#scalameta itself. Is there reason for not depending to it directly?
Kai(luo) Wang
@kailuowang
It's was the recommended settings from scalameta. Let me add the dependency in readme.
Odomontois
@Odomontois
Is this plugin is trying to rewrite methods from TC's companion object?
Odomontois
@Odomontois
Ok. I replaced underscore lambdas with arrow lambda and error has been gone
Kai(luo) Wang
@kailuowang
interesting, can you post the code here so that I can maybe do something?
or if you want you can create an issue so that you can subscribe to the fix process
Odomontois
@Odomontois
@kailuowang Yes. But my current code is little bit proprietary. But little bit later maybe, when I will have time to make small reproducible example
Kai(luo) Wang
@kailuowang
got it, thanks!
Odomontois
@Odomontois
How does autoDerivation work exactly?
Do I need to import MyTypeclass.autoDerivation._ or something like that?
Kai(luo) Wang
@kailuowang
yes.
Odomontois
@Odomontois
I have
value autoDerivation is not a member of object ...pack....MyTypeClass
error
I'm using it like
@autoFunctorK(autoDerivation = true)
Kai(luo) Wang
@kailuowang
it’s autoDerive
import MyTC.autoDerive._
Odomontois
@Odomontois
It's worked! Awesome
Now it's time to clean tonn of "MyMonad fromTask ..." lines
Kai(luo) Wang
@kailuowang
:clap:
Ronan Michaux
@ronan_michaux_twitter

I tried to upgrade my build, but it doesn't work

scalaVersion := "2.12.4"

scalacOptions ++= Seq("-Ypartial-unification", "-feature", "-Xfatal-warnings", "-deprecation", "-language:higherKinds")

// --- Kind Projector: https://github.com/non/kind-projector
resolvers += Resolver.sonatypeRepo("releases")
addCompilerPlugin("org.spire-math" %% "kind-projector" % "0.9.6")

// --- Mainecon: https://github.com/kailuowang/mainecoon
addCompilerPlugin("org.scalameta" % "paradise" % "3.3.1")
libraryDependencies ++= Seq(
  "org.scalameta"  %% "scalameta"        % "3.3.1" % Provided,
  "com.kailuowang" %% "mainecoon-macros" % "0.6.2"
)

Do you have a sample project ?

Kai(luo) Wang
@kailuowang
what error are you seeing?
Ronan Michaux
@ronan_michaux_twitter
[error] sbt.librarymanagement.ResolveException: unresolved dependency: org.scalameta#paradise;3.3.1: not found
Ronan Michaux
@ronan_michaux_twitter
I'm confused by addCompilerPlugin("org.scalameta" % "paradise" % "3.3.1") and "org.scalameta" %% "scalameta" % "3.3.1" % Provided.
Can you explain each role ?
Kai(luo) Wang
@kailuowang
the paradise compiler plugin is to provide macro support, i think you used the wrong version it should be “ 3.0.0-M9” for the compiler plugin
the "org.scalameta" %% "scalameta" % "3.3.1" % Provided is a library dependency
Ronan Michaux
@ronan_michaux_twitter
This build.sbt works:
scalaVersion := "2.12.4"

scalacOptions ++= Seq("-Ypartial-unification", "-feature", "-Xfatal-warnings", "-deprecation", "-language:higherKinds")

// --- Kind Projector: https://github.com/non/kind-projector
resolvers += Resolver.sonatypeRepo("releases")
addCompilerPlugin("org.spire-math" %% "kind-projector" % "0.9.6")

// --- Mainecon: https://github.com/kailuowang/mainecoon
addCompilerPlugin("org.scalameta" % "paradise" % "3.0.0-M11" cross CrossVersion.full)
scalacOptions += "-Xplugin-require:macroparadise"
scalacOptions in (Compile, console) ~= (_ filterNot (_ contains "paradise"))
libraryDependencies ++= Seq(
  "org.scalameta" %% "scalameta" % "1.8.0" % Provided,
  "com.kailuowang" %% "mainecoon-macros" % "0.6.2"
)
Kai(luo) Wang
@kailuowang
cool glad it worked out.
Kai(luo) Wang
@kailuowang
@/all this project is moved to cats-tagless new gitter chat room at https://gitter.im/typelevel/cats-tagless?utm_source=share-link&utm_medium=link&utm_campaign=share-link