Skip to content

Instantly share code, notes, and snippets.

View simmsb's full-sized avatar
💥
ghc: panic! (the 'impossible' happened)

Ben Simms simmsb

💥
ghc: panic! (the 'impossible' happened)
View GitHub Profile
From d54c091002aff8f74f8165dd21d65075f028e728 Mon Sep 17 00:00:00 2001
From: Ben Simms <ben@bensimms.moe>
Date: Mon, 24 Jun 2024 23:35:29 +0200
Subject: [PATCH] Draw fringe using bitmaps, not huge beziers
---
src/nsterm.m | 55 ++++++++++++++++++++++++----------------------------
1 file changed, 25 insertions(+), 30 deletions(-)
diff --git a/src/nsterm.m b/src/nsterm.m
use std::io::Write;
use std::net::Ipv6Addr;
use std::path::PathBuf;
use clap::Parser;
use image::{AnimationDecoder, Frame, GenericImageView, Pixel, Rgb};
use massping::packet::EchoRequestPacket;
use socket2::Domain;
#[derive(clap::Parser)]
@simmsb
simmsb / return_0.c
Last active October 13, 2022 23:46
#include <stdlib.h>
#include <string.h>
#include "base.h"
#include "builtin.h"
struct env_45 {struct obj *v_k_205;struct obj *v_while_202;struct obj *v_for_204;};
void lambda_45(struct obj *, struct obj *, struct env_obj *)__attribute__((noreturn)) ;
struct env_47 {struct obj *v_k_201;struct obj *v_rv_282;};
void lambda_47(struct obj *, struct env_obj *)__attribute__((noreturn)) ;
struct env_12 {struct obj *v_inner_232;struct obj *v_k_244;struct obj *v_it_241;struct obj *v_body_230;};
void lambda_12(struct obj *, struct obj *, struct env_obj *)__attribute__((noreturn)) ;
import pymesh
rules = """
""".strip().splitlines()
def parse_rule(r: str):
on, c = r.split(" ")
on = on == "on"
struct packet
{ char * pkt;
uint32_t idx;
};
struct JPv4_h
{ uint32_t dstAddr;
uint32_t srcAddr;
uint16_t hdrChecksum;
uint8_t protocol;
uint8_t ttl;
#include "base.h"
#include "builtin.h"
#include <stdlib.h>
#include <string.h>
struct env_34 {
struct obj *v_rv_448;
struct obj *v_k_447;
};
void lambda_34(struct obj *, struct env_obj *) __attribute__((noreturn));
@simmsb
simmsb / hehe.c
Created September 26, 2020 08:44
hehe
#include "base.h"
#include "builtin.h"
#include <stdlib.h>
#include <string.h>
struct env_24 {
struct obj *v_map_996;
struct obj *v_k_1030;
struct obj *v_f_1029;
};
@simmsb
simmsb / bot.py
Created August 20, 2020 22:36
Dame bot
import asyncio
import tempfile
import discord
from discord.ext import commands
from discord.ext.alternatives import asset_converter, literal_converter
from urllib.parse import urlparse
from typing import Literal
import os
@simmsb
simmsb / combinators.py
Created April 19, 2020 01:37
Parser combinators
from functools import wraps
from typing import Optional, Tuple, TypeVar, Callable, Coroutine, List, Any
NoneType = type(None)
class StringView:
def __init__(self, s: str, idx: int = 0):
self.s = s
self.idx = idx
self.end = len(s)
*** Exception (reporting due to +RTS -xc): (THUNK), stack trace:
GhcMod.Cradle.stackCradle,
called from GhcMod.Cradle.findCradle',
called from Control.Monad.Trans.Journal.runJournalT,
called from GhcMod.Monad.withGhcModEnv.withCradle,
called from GhcMod.Monad.withGhcModEnv',
called from GhcMod.Monad.withGhcModEnv,
called from GhcMod.Monad.Newtypes.>>=,
called from Control.Monad.Trans.Control.control,
called from Control.Monad.Trans.Control.liftBaseOp.\,