This file contains hidden or 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 std; | |
struct notrace {} | |
struct string_tracetail { | |
string value; | |
alias value this; | |
} | |
class ReactorFiber{ | |
string_tracetail funcName; | |
@notrace setCallback(alias F)() { | |
funcName = fullyQualifiedName!F; |
This file contains hidden or 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 C<T> {} | |
T? f<T>(C<T> c) => null; | |
int? g(C<int?> c) => f(c); |
This file contains hidden or 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
abstract class A { | |
@override | |
bool operator ==(Object? other); | |
} | |
class B implements A {} | |
void test(dynamic x, dynamic y, dynamic z) { | |
print(x == y || x == z); | |
} |
This file contains hidden or 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
abstract class A { | |
@override | |
bool operator ==(dynamic other); | |
} | |
class B implements A {} | |
void test(dynamic x, dynamic y, dynamic z) { | |
print(x == y || x == z); | |
} |
This file contains hidden or 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 A { | |
int f() => 1; | |
} | |
class B extends A { | |
int f(); | |
} | |
void main() { | |
print(B().f()); |
This file contains hidden or 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
#include <iostream> | |
#include <vector> | |
using namespace std; | |
class Psycos { | |
public: | |
Psycos(const vector<int> &a) : a(a) {}; | |
int nextPeak(int i) { | |
/* return next peak on the right index or -1 if there is no more peaks */ |
This file contains hidden or 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
Require Import ZArith. | |
Require Import List. | |
Require Import Program.Wf. | |
Import ListNotations. | |
(** Copied from https://github.com/tchajed/strong-induction *) | |
(** Here we prove the principle of strong induction, induction on the natural | |
numbers where the inductive hypothesis includes all smaller natural numbers. *) |
This file contains hidden or 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
-- InFor n -> for (g $ InFor f) $ \y -> for (runForFor (f $ ForFor $ \_ -> y) NotInFor) $ \x -> | |
-- _ | |
data ForFor r t a where | |
For :: r (t a) -> (r a -> r (t b)) -> ForFor r t (t b) | |
Other :: r a -> ForFor r t a | |
unForFor :: Sqlam r t => ForFor r t a -> r a | |
unForFor (For m n) = for m n |
This file contains hidden or 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
module Main where | |
import System.Environment | |
import System.Exit | |
import Text.Parsec | |
main :: IO () | |
main = do | |
args <- getArgs | |
case args of |
This file contains hidden or 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
data Val = VNum Double | VBool Bool | |
toNumber :: Val -> Double | |
toNumber (VNum x) = x | |
toNumber (VBool True) = 1 | |
toNumber (VBool False) = 0 | |
main :: IO () | |
main = print $ (* (-1)) $ toNumber (VBool False) |
NewerOlder