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 zio.* | |
import zio.test.* | |
import zio.test.Assertion.{equalTo, assertion} | |
import com.dimafeng.testcontainers.KafkaContainer | |
import zio.kafka.consumer.ConsumerSettings | |
import zio.kafka.producer.ProducerSettings | |
import zio.kafka.consumer.Consumer | |
import io.github.scottweaver.zio.testcontainers.kafka.ZKafkaContainer | |
import zio.kafka.consumer.Consumer.OffsetRetrieval | |
import zio.kafka.consumer.Consumer.AutoOffsetStrategy |
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
#!/usr/bin/env bash | |
echo "hello world" |
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; | |
import scuts.implicit.Wildcard; | |
import scuts.implicit.Implicit; | |
import scuts.implicit.Instances; | |
import Main.BoolInstance.instance; | |
// for nicer syntax |
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
charCodeAt 1 native 0 : 1x | |
charCodeAt 1 ucs2 0.0001 : 1.4x | |
charCodeAt 1 utf32 0.0001 : 1.12x | |
charCodeAt 1 utf8 0.0002 : 2.27x | |
charCodeAt 1 utf16 0.0001 : 1.49x | |
charCodeAt n native 0 : 1x | |
charCodeAt n ucs2 0.0001 : 1.46x | |
charCodeAt n utf32 0.0001 : 1.08x | |
charCodeAt n utf8 0.1279 : 1279.94x | |
charCodeAt n utf16 0.0918 : 918.07x |
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
// fast byte access without class overhead and bounds checks like in haxe.io.Bytes | |
package haxe.io; | |
@:coreType abstract ByteArray { | |
public static var getIsChecked:Bool; // flags can be used in bytes to remove unnecessary or multiple bounds checks on different targets | |
public static var setIsChecked:Bool; | |
public static var blitCanThrow:Bool; // throws are neko specific flags, can be used in bytes to remove a bounds check | |
public static var subCanThrow:Bool; |
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; |
NewerOlder