elect
12/14/2021, 10:06 AM@OptIn(ExperimentalContracts::class)
and I choose to put it at the level file (@file:OptIn(ExperimentalContracts::class)
) will still only those methods require that marker or the whole class now?
Also, I marked the class methods, but in the docs I read
Only the top-level functions can have a contract for nowwhich doesn't seem the case.. maybe it's outdated?
elect
12/15/2021, 10:38 AM[GLSL dot man page](<http://www.opengl.org/sdk/docs/manglsl/xhtml/dot.xml>)
while this is fine instead
[GLSL](<http://www.opengl.org/sdk/docs/manglsl/xhtml/dot.xml>)
An Tran
12/15/2021, 5:25 PMStylianos Gakis
12/22/2021, 12:13 PMclass SomeUseCase(//dependencies) {
sealed class Error {
object NetworkError : Error()
object NoResultFound : Error()
}
sealed class Success {
object OneSuccess : Success()
object TwoSuccess : Success()
}
suspend operator fun invoke(): Either<Error, Success> {//code}
}
Where each out of many use cases may have their own domain error/success cases but then we have Success
or Error
pollute the entire code-base namespace which makes it a bit annoying to work with.
I know the internal
modifier exists but for various reasons we can’t just modularize our codebase, at least not instantaneously.
In Java I’d slap a package private in there and call it a day, does anyone have any tips on how to model this nicer?dave08
12/22/2021, 12:16 PMBrian Dilley
01/01/2022, 8:34 AMIhor Kviten
01/05/2022, 8:41 PMPablo
01/06/2022, 8:00 AMJasin Colegrove
01/06/2022, 5:20 PMinline fun Document.addParagraph(title: String, block: Paragraph.() -> Unit) {
add(Paragraph(title).apply(block))
}
Jasin Colegrove
01/06/2022, 5:20 PMinline fun Document.addParagraph(title: String, block: Paragraph.() -> Unit) {
add(Paragraph(title).apply(block))
}
Rodrigo Bressan De Souza
01/07/2022, 2:22 PMAyfri
01/09/2022, 8:23 PMKebbin
01/10/2022, 12:32 PM"string".toByteArray
before sending, and also sent the sequence in ASCII code, but I can't get the expected response.
This is an Arduino comm project, and I found this very helpful page: https://forum.arduino.cc/t/trying-to-communicate-to-arduino-with-jserialcomm-and-kotlin/913482 that got me going.
Has anyone done this before? Thanks!Coffee Guy
01/13/2022, 4:20 PMCoffee Guy
01/13/2022, 4:24 PMMarko Novakovic
01/16/2022, 3:15 PMUseCase
, for example, or anything else that has common structure and needs input and output parameters:
1. having UseCase
interface like this:
fun interface UseCase<Parameters, Result> : suspend (Parameters) -> Result
class SomeUseCase : UseCase<String, Int> {
override suspend fun invoke(parameter: String): Int = parameter.toInt()
}
2. extending function for every instance:
class SomeUseCase : suspend (String) -> Int {
override suspend fun invoke(parameter: String): Int = parameter.toInt()
}
2nd approach allows for passing multiple parameters instead of just one
with 1st approach we need to group parameters inside an data class
and unpack then when we need them which makes sense because those are cohesive information for given UseCase
am open for ideas/suggestionsrocketraman
01/18/2022, 10:48 PMHumayoun Kabir Emon
01/19/2022, 8:17 PMJim
01/21/2022, 5:53 PMJose Pasquini
01/23/2022, 3:53 PMJochen Guck
01/28/2022, 8:17 AMLastExceed
01/30/2022, 1:46 PMType mismatch.
Required: suspend (Int) → Int
Found: (Int) → Int
tbh i find it weird that i MUST rely on type inference to create such a lambda in the first placeTim Oltjenbruns
02/08/2022, 1:57 AMzilin jin
02/11/2022, 8:48 AMAdvitiay Anand
02/11/2022, 9:56 PMv79
02/12/2022, 5:33 PM@sendsEvent
in the kdoc block and have IntelliJ recognise that.Milse113
02/13/2022, 9:25 PMArash Rostami
02/14/2022, 9:07 AMEnoc Gutierrez
02/14/2022, 9:32 PM