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
{-# OPTIONS_GHC -Wall -ddump-to-file -ddump-rn -ddump-foreign -ddump-stg -ddump-cmm-raw -ddump-asm #-} | |
module AsteriusPrim | |
( emptyJSString, | |
concatJSString, | |
indexJSString, | |
toJSString, | |
fromJSString, | |
emptyJSArray, | |
concatJSArray, |
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
-- In subdirectory `target/A.hs` | |
module A where |
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
import kotlin.collections.* | |
import org.reactivestreams.* | |
import kotlinx.coroutines.channels.* | |
import kotlinx.coroutines.reactive.* | |
import kotlinx.coroutines.* | |
import kotlin.coroutines.* | |
@ExperimentalCoroutinesApi | |
fun <T, U> Publisher<T>.debounce(timeout: Long, ctx: CoroutineContext) = GlobalScope.publish(ctx) { | |
var idx = 0; |
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
<?hh // strict | |
interface Base { | |
public function foo(this $v): void; | |
} | |
final class Derived<T> implements Base { | |
public function bar(): void {} | |
public function foo(this $v): void { | |
$v->bar(); // an `OtherDerived` here would be unwelcome. | |
} | |
} |
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
<?hh // strict | |
<<__ConsistentConstruct>> | |
abstract class ConWrapper<-T> { | |
public function __construct() {} | |
abstract public function act(T $v): void; | |
} | |
class ConcreteWrapper extends ConWrapper<OtherBase> { | |
public function act(OtherBase $v): void { | |
$v->fn(); | |
} |
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
<?hh // strict | |
class Forever { | |
private ?Awaitable<?(mixed, int)> $hook = null; | |
public function __construct() { | |
} | |
public async function loop(): Awaitable<void> { | |
$generator = $this->sub(); | |
await ($this->hook = $generator->next()); | |
} | |
private async function sub(): \AsyncIterator<int> { |