prat
09/02/2017, 7:45 PMtestLaws(SemigroupKLaws.laws(SequenceKW.semigroupK(), applicative, Eq.any()))
and it failed
java.lang.AssertionError: Property failed for
SequenceKW(sequence=kotlin.collections.ArraysKt___ArraysKt$asSequence$$inlined$Sequence$1@5d5abcb9)
SequenceKW(sequence=kotlin.collections.ArraysKt___ArraysKt$asSequence$$inlined$Sequence$1@2973d20a)
SequenceKW(sequence=kotlin.collections.ArraysKt___ArraysKt$asSequence$$inlined$Sequence$1@1ec9a588))
at io.kotlintest.properties.PropertyTestingKt.forAll(PropertyTesting.kt:43)
at kategory.data.SequenceKWTest$$special$$inlined$laws$1.invoke(SemigroupKlaws.kt:17)
at kategory.data.SequenceKWTest$$special$$inlined$laws$1.invoke(SemigroupKlaws.kt:6)
at io.kotlintest.Spec$runTest$callable$1$1.invoke(Spec.kt:124)
at io.kotlintest.Spec$runTest$callable$1$1.invoke(Spec.kt:15)
at io.kotlintest.Spec$runTest$initialInterceptor$1$1.invoke(Spec.kt:116)
at io.kotlintest.Spec$runTest$initialInterceptor$1$1.invoke(Spec.kt:15)
at io.kotlintest.Spec.interceptTestCase(Spec.kt:78)
at io.kotlintest.Spec$runTest$initialInterceptor$1.invoke(Spec.kt:116)
at io.kotlintest.Spec$runTest$initialInterceptor$1.invoke(Spec.kt:15)
at io.kotlintest.Spec$runTest$callable$1.call(Spec.kt:124)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
any thought?raulraja
09/05/2017, 4:35 PMraulraja
09/14/2017, 10:30 PMisSubtype
for TypeMirror
comparisons and it does not work so I'm recursing all interfaces as I did before and comparing Stringsraulraja
09/14/2017, 10:31 PMraulraja
09/17/2017, 8:35 PMraulraja
10/04/2017, 7:55 AMMonadError<F, NukeException>
exist. In the case of Option
it can't provide such an instance because there is no way to store the NukeException
, since None
which is the unbiased case can't store that error. Same for Try
since it's Failure
it's fixed to Throwable
and NukeException
is not in the Throwable
hierarchy. The only choice here is Either
which is parametric in it's Left
case.
attack
may be invoked in two different ways:https://gist.github.com/raulraja/40ac0d0f03f4a1a85f6d249464f30a95raulraja
10/05/2017, 8:53 PM.p()
do?simon.vergauwen
10/10/2017, 11:56 AMraulraja
10/30/2017, 2:27 PMobject test {
sealed class BizError {
object Error1 : BizError()
object Error2 : BizError()
object Error3: BizError()
}
val ops: List<ValidatedNel<BizError, Int>> = listOf(
1.validNel(),
1.validNel(),
1.validNel(),
BizError.Error1.invalidNel(),
BizError.Error2.invalidNel(),
BizError.Error3.invalidNel()
)
val result: ValidatedNel<BizError, Int> = ops.reduce { a, b ->
a.combine(b, NonEmptyList.semigroup())
}
}
raulraja
10/31/2017, 12:09 PMJorge Castillo
11/03/2017, 2:51 PMraulraja
11/05/2017, 9:36 PMsnrostov
11/06/2017, 10:19 AM// in existed module
data class User(val name: String)
// in other module
object UserRenderer: Renderer<User> {
fun User.render() = Row {
+Column { +"Name: " }
+Column { +name }
}
}
fun someOtherComponent(user: User)
= Row { +user }
raulraja
11/07/2017, 2:57 PMinterface Context<A> {
fun A.config(): Config
}
package prod
object ProdContext: Context<Service> {
fun Service.config(): Config = ProdConfig
}
package test
object TestContext: Context<Service> {
fun Service.config(): Config = TestConfig
}
package prod
service.config() // ProdConfig
package test
service.config() // TestConfig
pakoito
12/02/2017, 11:39 PMraulraja
12/02/2017, 11:39 PMpakoito
12/20/2017, 7:02 PMkevinherron
12/20/2017, 10:26 PMcrossinline
modifier from the parameters to map
and flatMap
allow me to call suspending functions. if you’d like, I’ll PR those changes as well. I suspect there’s more than just the Try
data structure being affected by this.dh44t
12/22/2017, 9:49 AMalex.hart
01/04/2018, 12:20 PMpakoito
01/15/2018, 5:33 PMdh44t
01/18/2018, 2:59 PMyousuf.haque
01/18/2018, 3:30 PMOption
?raulraja
01/19/2018, 12:04 AMrawtoast
01/24/2018, 1:48 PMOption(null)
(returns None
) and Some(null)
(returns an Option holding null
). It’s understandable but can be confusing and lead to bugs as not everyone knows this edge case. So for safety you end up creating/assigning with Option
and only using Some
for pattern matching/test assertions.
Not really tried that in Kotlin, as I tend to use Option.fromNullable which seems to work in a sane manner 🙂aeruhxi
01/24/2018, 6:31 PMSome(null)
doesn't make sense at all 🤔raulraja
02/04/2018, 1:56 AMraulraja
02/08/2018, 12:47 PMthanerian
02/08/2018, 8:31 PMsimon.vergauwen
02/12/2018, 10:05 AM