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
Fatal error: exception Not_found | |
Raised at file "hashtbl.ml", line 97, characters 23-32 | |
Called from file "gencommon.ml", line 4544, characters 30-60 | |
Called from file "type.ml", line 1670, characters 27-31 | |
Called from file "type.ml", line 1654, characters 11-15 | |
Called from file "type.ml", line 1713, characters 26-30 | |
Called from file "type.ml", line 1672, characters 32-38 | |
Called from file "type.ml", line 1694, characters 11-15 | |
Called from file "list.ml", line 57, characters 20-23 | |
Called from file "type.ml", line 1680, characters 26-41 |
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
interface T1<X> { | |
public function foo <A>(a:X, c:A):Void; | |
} | |
abstract A1<X>(X) { | |
public function new (x:Dynamic) this = x; | |
} | |
class U1 implements T1<A1<Dynamic>> { |
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
return switch (Type.typeof(v)) { | |
case TObject, TClass(_): true; | |
case _ : false; | |
} | |
// becomes something like: | |
_g = Type.typeof(v); | |
return switch ((@:exhaustive _g.index)) { |
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 MyMacros { | |
macro public static function configX (a:Expr):ExprFunc<Void->Expr> { | |
return function ():Expr { | |
return macro ($a); | |
} | |
} | |
macro public static function configPlus (a:Expr):ExprFunc<Expr->Expr> { | |
return function (x:Expr):Expr { |
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
using Using; | |
class Using { | |
public static function fmap <M,A,B>(x:Of<M, A>, f:A->B, functor:Functor<M>):M<B> {...} | |
} | |
var x : Of<Map<Int, In>, String> = [ 1 => "foo" ]; | |
x.| // completion (field access) here (Map functions like exists, get etc. and from using fmap, because we "follow" first (because lifting is nonambigious here, because we always apply the In type from the right) |
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
using FunctorSyntax; | |
using ArrayT; | |
enum Either<L,R> { | |
Left(l:L); | |
Right(r:R); | |
} | |
interface Functor<F> { | |
public function fmap<A,B>(x:F<A>, f:A->B):F<B>; |
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
interface Filterable<M, A> { | |
public function filter (f:A->Bool):Of<M,A>; | |
} | |
class MyArray<A> implements Filterable<MyArray<In>, A> { | |
var a:Array<A>; | |
public function new (?a:Array<A>) { | |
this.a = a == null ? [] else a; | |
} | |
public function filter(f:A->Bool):MyArray<A> { |
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
interface Category<M> | |
{ | |
// identity value in this category | |
public function id <A>():OfOf<M, A, A>; | |
/** | |
* Category composition Operator. | |
* | |
**/ | |
public function dot <A,B,C>(g:OfOf<M, B, C>, f:OfOf<M, A, B>):OfOf<M, A, C>; |
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
using Main.PosBuilders; | |
typedef Pos = { x: Int, y:Int}; | |
private extern class ISSET {} | |
private extern class UNSET {} | |
@:allow(Main.PosBuilders) class PosBuilder<X,Y> { | |
public function new (x,y) { | |
this.x = x; |
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 ; | |
using TestX.Eqs; | |
// consider the following interfaces | |
interface Compare<T> { | |
public function compare(b:T):Int; | |
} | |
interface Eq<T> { |