Skip to content

Instantly share code, notes, and snippets.

View voxxal's full-sized avatar

voxxal

  • school, unfortunately
  • 0°00'00"N 0°00'00"E
View GitHub Profile
@voxxal
voxxal / ts.zig
Created November 26, 2024 06:34
typescript utility types in zig
const std = @import("std");
const StructField = std.builtin.Type.StructField;
fn Partial(comptime inner: type) type {
var typeInfo = @typeInfo(inner);
switch (typeInfo) {
.@"struct" => |*structure| {
var fields: []const StructField = &[0]StructField{};
for (structure.fields) |field| {

Binomial Probability

Exercise to learn more about rust's type system. If you know a way to implement a trait on all itertors please tell me.