Skip to content

Instantly share code, notes, and snippets.

class FunR<A, B>(private val f: (FunR<A, B>) -> (A) -> B) {
operator fun invoke(a: FunR<A, B>): (A) -> B = f(a)
}
fun <A, B> y(f: ((A) -> B) -> (A) -> B): (A) -> B =
FunR<A, B> { r -> f { a -> r(r)(a) } }.let { g -> g(g) }
val fac = y { f: (Int) -> Int ->
{ x ->
if (x <= 1) 1 else x * f(x - 1)
@pardom
pardom / PlaceholderText.kt
Created April 15, 2020 16:29
Compose PlaceholderText
@Composable
fun PlaceholderText(
text: String,
color: Color = Color.LightGray,
shape: Shape = RoundedCornerShape(2.dp),
modifier: Modifier = Modifier.None,
style: TextStyle = currentTextStyle(),
softWrap: Boolean = true,
overflow: TextOverflow = TextOverflow.Clip,
maxLines: Int = Int.MAX_VALUE,