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.functional, | |
std.typecons, | |
std.traits, | |
std.meta; | |
class PatternIsNull {} | |
class PatternWithValue(P = PatternIsNull, F: R delegate(), R: R) { | |
P pattern; | |
F func; |
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
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- | |
* | |
* Copyright (C) 2004 Christian Hammond. | |
* Copyright (C) 2017 Akihiro Shoji. | |
* | |
* This library is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU Lesser General Public | |
* License as published by the Free Software Foundation; either | |
* version 2.1 of the License, or (at your option) any later version. | |
* |
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 <stdlib.h> | |
#include <stdio.h> | |
#define testSize 4194304UL | |
#define ulong unsigned long long | |
//#define SHOW | |
typedef struct test { | |
ulong id; | |
char buf[1024]; |
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.algorithm, | |
std.format, | |
std.array; | |
interface Expr { | |
string stringof(); | |
string[] freeVars(); | |
void replaceIdentifier(string, string); | |
Expr dup(); |
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.algorithm, | |
std.format, | |
std.string, | |
std.array, | |
std.stdio; | |
interface Term { | |
string toString(); | |
Term apply(Term); | |
Term apply(); |
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.algorithm, | |
std.traits, | |
std.format, | |
std.range, | |
std.array; | |
bool instanceof(alias Type, alias Variable)() { | |
return (cast(Type)Variable) !is null; | |
} |
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.stdio; | |
import std.typecons, | |
std.format, | |
std.traits, | |
std.range; | |
bool instanceof(alias Type, alias Variable)() { | |
return (cast(Type)Variable) !is null; | |
} |
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
- | |
- - | |
- * - | |
- - - - | |
- * * * - | |
- - * * - - | |
- * - * - * - | |
- - - - - - - - | |
- * * * * * * * - | |
- - * * * * * * - - |
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.traits, | |
std.conv; | |
/* | |
class Functor F where | |
fmap :: (A -> B) -> FA -> FB | |
*/ | |
interface Functor(F) { | |
F fmap(AB = typeof((A _) => B.init), A, B)(AB, 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
import std.stdio, | |
std.traits; | |
class Type(_type) { alias type = _type; } | |
class Holder(Types...) { | |
alias Types Holder; | |
alias types = Types; | |
} |