Skip to content

Instantly share code, notes, and snippets.

View mjepronk's full-sized avatar

Matthias Pronk mjepronk

View GitHub Profile
@chrisdone
chrisdone / Intro.md
Last active May 20, 2024 12:44
Statically checked overloaded strings

Statically checked overloaded strings

This gist demonstrates a trick I came up with which is defining IsString for Q (TExp a), where a is lift-able. This allows you to write $$("...") and have the string parsed at compile-time.

On GHC 9, you are able to write $$"..." instead.

This offers a light-weight way to enforce compile-time constraints. It's basically OverloadedStrings with static checks. The inferred return type

@zeffii
zeffii / bvp_to_svg.py
Created June 28, 2012 16:27
blender viewport to svg
import bpy
from bpy_extras.view3d_utils import location_3d_to_region_2d as loc3d2d
import os
def write_svg(edge_list, region):
width, height = region.width, region.height