This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.testmbs | |
import android.os.Bundle | |
import androidx.activity.ComponentActivity | |
import androidx.activity.compose.setContent | |
import androidx.activity.enableEdgeToEdge | |
import androidx.compose.foundation.background | |
import androidx.compose.foundation.clickable | |
import androidx.compose.foundation.layout.Box | |
import androidx.compose.foundation.layout.Column |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.frpeffsample.effector | |
import kotlinx.coroutines.CoroutineScope | |
import kotlinx.coroutines.DelicateCoroutinesApi | |
import kotlinx.coroutines.Dispatchers | |
import kotlinx.coroutines.GlobalScope | |
import kotlinx.coroutines.channels.BufferOverflow | |
import kotlinx.coroutines.flow.MutableSharedFlow | |
import kotlinx.coroutines.flow.MutableStateFlow | |
import kotlinx.coroutines.flow.StateFlow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val addClicked = Event.create<Unit>() | |
val textChanged = Event.create<String>() | |
val itemDeleted = Event.create<Int>() | |
private val itemAdded = Event.create<String>() | |
val storeText = Store.create("") | |
.on(textChanged) { _, newText -> newText } | |
.reset(itemAdded) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type WebPart = interface end | |
let reduceWebPart rules = | |
let emptyNodeParse _ n = failwithf "No resolver for: %O" n | |
let rec makeReducer (next: (WebPart -> _) -> WebPart -> _) (wp: WebPart) = | |
next (makeReducer next) wp | |
makeReducer (rules |> List.fold (fun a b -> b a) emptyNodeParse) | |
// =============== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns domain) | |
(listen-event | |
:item-created | |
(fn [e] | |
{:fetch {:url "https://backend.com/save" | |
:body {:text (:text e)}}})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package kotlin.time | |
inline class Instant(val value: Duration) : Comparable<Instant> { | |
companion object { | |
val ZERO = Instant(Duration.ZERO) | |
fun fromUnixTimeSeconds(time: Long): Instant = | |
Instant(time.seconds) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class OpenClass { } | |
class FirstOpenClass : OpenClass { } | |
class SecondOpenClass : OpenClass { } | |
class Foo <TGen> where TGen : OpenClass, new() { | |
public TGen open = new TGen(); | |
} | |
SecondOpenClass foo = new Foo<SecondOpenClass>().open; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open class OpenClass | |
class FirstOpenClass : OpenClass() | |
class SecondOpenClass : OpenClass() | |
class Foo<TGen : OpenClass>( | |
val open: TGen = FirstOpenClass() as TGen | |
) { | |
companion object { | |
fun build() = Foo(FirstOpenClass()) //it’s OK | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static class ResultPair { | |
String response; | |
List<User> altered; | |
} | |
public Response subscriptionConfirmed(Message message, int addDays, String messageText, String userFilter) { | |
LocalDateTime now = LocalDateTime.now(); | |
List<User> users = findUsers(message.getFrom(), userFilter); | |
ResultPair result = pureLogic(message, addDays, now, users); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System | |
open FSharp.Data | |
type OnboardingType = XmlProvider<".data/onboarding.xml"> | |
module Domain = | |
open SlackAPI | |
let toBlocks (cmd : OnboardingType.Command) : IBlock array = | |
cmd.Items | |
|> Seq.map ^ fun x -> |
NewerOlder