Skip to content

Instantly share code, notes, and snippets.

View ulysses4ever's full-sized avatar
🐢

Artem Pelenitsyn ulysses4ever

🐢
View GitHub Profile
@pdarragh
pdarragh / papers.md
Last active April 17, 2024 19:29
Approachable PL Papers for Undergrads

Approachable PL Papers for Undergrads

On September 28, 2021, I asked on Twitter:

PL Twitter:

you get to recommend one published PL paper for an undergrad to read with oversight by someone experienced. the paper should be interesting, approachable, and (mostly) self-contained.

what paper do you recommend?

@chrisdone
chrisdone / Intro.md
Last active April 10, 2023 06:33
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

@hsyl20
hsyl20 / ghc_gitlab.user.js
Created January 14, 2019 16:16
Add some buttons to Gitlab instance of GHC
// ==UserScript==
// @name Gitlab discussion helper
// @version 1
// @grant none
// @description This script let you toggle all discussions in Gitlab
// @include https://gitlab.haskell.org/*
// @run-at document-idle
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js
// ==/UserScript==
#!/usr/bin/env stack
-- stack --resolver=lts-9.0 script --package=lens --package=template-haskell
{-# OPTIONS -Wall -Werror -ddump-splices #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TemplateHaskell #-}
# Syntax Extensions
BangPattern
NPlusKPatterns
PatternGuards, PatternSynonyms, ViewPatterns
LambdaCase, EmptyCase, MultiWayIf
ParallelListComp, ParallelArrays, MonadComprehensions, TransformListComp
RebindableSyntax, NoImplicitPrelude
PostfixOperators
TupleSections
DisambiguateRecordFields, NamedFieldPuns, RecordWildCards, RecordPuns
@dkorolev
dkorolev / variadic_visitor.cc
Created April 26, 2015 06:34
C++11 Visitor Pattern with Variadic Template
#include <cstdio>
#include <vector>
#include <utility>
// Library code.
template<typename>
struct Visitor {
};