pakoito
03/08/2019, 7:03 PMsam
03/09/2019, 1:02 PMpakoito
03/09/2019, 1:05 PMsam
03/09/2019, 1:05 PMShow
to generate printable strings rather than toString. I don't know if we should look up instances using SPI or if there's a better waypakoito
03/09/2019, 1:07 PM(A) -> String
and from our side we can add the Show wrappingssam
03/09/2019, 1:10 PMsam
03/09/2019, 1:11 PMpakoito
03/09/2019, 1:11 PMpakoito
03/09/2019, 1:12 PMGen
had a function for toString()
with a defaultsam
03/09/2019, 1:12 PMsam
03/09/2019, 1:12 PMpakoito
03/09/2019, 1:13 PMpakoito
03/09/2019, 1:14 PMinterface Gen<A> {
fun show(): Show<A> = Show.any()
}
that’d be enoughsam
03/09/2019, 1:15 PMperson shouldBe Person("sam")
then it will call .toString on person, but if there was a Show[Person] registered via SPI then it could look it up and use it.sam
03/09/2019, 1:16 PMpakoito
03/09/2019, 1:16 PMsam
03/09/2019, 1:17 PMShow<A<B>>
?pakoito
03/09/2019, 1:17 PMpakoito
03/09/2019, 1:17 PMsam
03/09/2019, 1:17 PMpakoito
03/09/2019, 1:17 PMShow<A<Int>>
!= Show<A<User>>
pakoito
03/09/2019, 1:17 PMsam
03/09/2019, 1:17 PMShow<Foo<Boo>>
by introspecting the types. I don't know if that helps.pakoito
03/09/2019, 1:17 PMraulraja
03/09/2019, 1:18 PMGen
module depended on arrow-core
we can just derive anything we need in the arrow side because it would allows us to provide instances for Gen including automatic derivation for data classes, etc. https://github.com/arrow-kt/kotlintest/blob/rr-kotlin-test-arrow-revamp/kotlintest-assertions/src/main/kotlin/io/kotlintest/properties/Gen.kt#L57raulraja
03/09/2019, 1:18 PMraulraja
03/09/2019, 1:19 PMfx
as a monad and create complex generators even for effectful functionssimon.vergauwen
03/09/2019, 1:19 PMraulraja
03/09/2019, 1:19 PMraulraja
03/09/2019, 1:19 PM