Hi :slightly_smiling_face: I’m curious about the A...
# kotlintest
w
Hi 🙂 I’m curious about the Arrow dependency that’s pulled in with KotlinTest — did you have a discussion somewhere about it being not part of the public API? For example having Arrow matchers in a separate artifact, and if KotlinTest uses Arrow internally then not exposing it? I’m not using Arrow but with KotlinTest I get tons of extension functions from it on most of the classes. Should I just e.g. exclude Arrow transitive dependency if I’m not gonna use those matchers? I only recall there was some discussion about splitting core and matchers into multiple artifacts but afaik the result was that there will be only one artifact. Maybe it’s something that could be reconsidered for the next major version?
l
I believe that arrow is an implementation dependency only, isn't it?
So it doesn't get shipped along with KT itself
w
🤔 perhaps I have misconfigured something
l
I think that's what expected. If arrow is getting shipped (and not only used) with KT, that's likely a mistake
w
There’s
api "io.arrow-kt:arrow-core:$arrow_version"
in
kotest-assertions/build.gradle
Here’s
testCompileClasspath
from my project, I omitted non-kotlintest dependencies:
Copy code
+--- io.kotlintest:kotlintest-runner-junit5 -> 3.4.2
|    +--- io.kotlintest:kotlintest-core:3.4.2
|    |    \--- io.kotlintest:kotlintest-assertions:3.4.2
|    |         +--- io.arrow-kt:arrow-core-data:0.9.0
|    |         |    \--- io.arrow-kt:arrow-annotations:0.9.0
l
That
api
should probably be an
implementation
, I suppose?
What might have happened?
w
Wouldn’t it be an issue when you actually have public api that use Arrow classes?
l
I don't think so
There was a big discussion at #feed earlier this year about exactly this
w
Yep, I now see the same for
ktor
assertions
l
How
implementation
let's your project work but
api
brings those classes to the user
Yep, I now see the same for
ktor
assertions
The same as in
api
or
implementation
?
w
Sorry, I meant
ktor-assertions
has
implementation
dependency on ktor
So such dependency is fine
l
So we probably could change this
w
Does KotlinTest use Arrow classes internally?
l
Yes
w
And in the assertions project too?
l
I think we do for somethings, although I'm not sure
w
I don’t see any
arrow
string in
kotest-assertions/src
directory
Perhaps Arrow can be removed from that module completely?
I’m looking for Arrow usage outside arrow-assertions module, and tbh I see little reason to even use it at all. Most of the APIs used are
Try
,
Success
and
Failure
, and this is quite trivial to implement manually, and a big dependency could be removed as a result
Seems like most of it could even be covered by Kotlin’s Result class
l
@sam What do you think about this? Perhaps we don't need to include Arrow in KT?
s
I think we would continue to use arrow more and more in the implementation. I’m a big fan. But shouldn’t
implementation
be hiding this anyway ?
l
I think it's not
implementation
and that's why it's being shipped
s
Ok lets change it
Although I've has issues with implementation if it's exposed
Eg in hoplite
But I don't think we expose any arrow classes
l
As in we return something from arrow, right? I think the only parts in which we expose it is inside arrow module itself
s
Yeah it's only used internally
Lets switch it to implementation