Skip to content

Instantly share code, notes, and snippets.

@aisamanra
aisamanra / Makefile
Created May 17, 2019 00:28
C++ module example
CPPFLAGS = -std=c++1z -fmodules-ts
ALL: main
main: speech.o main.cc
clang++ $(CPPFLAGS) -fprebuilt-module-path=. -o $@ $^
speech.o: speech.pcm
clang++ $(CPPFLAGS) -o $@ -c $<
#[derive(Debug)]
enum Expr {
Var { x: u32 },
App { f: ExprRef, arg: ExprRef },
Lam { body: ExprRef },
}
use Expr::*;
#[derive(Debug, Copy, Clone)]
@aisamanra
aisamanra / tokile.rb
Created March 10, 2022 03:56
A terminal-based Wordle clone for four-letter Toki Pona words
require 'csv'
require 'set'
module Tokile
YELLOW = "\x1b[33m"
GREEN = "\x1b[32m"
CLEAR = "\x1b[39m"
UP = "\033[F"
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Applicative ((<|>))
import qualified Data.SCargot as SCargot
import qualified Data.SCargot.Language.Basic as SCargot
import Data.SCargot.Repr.Basic
import Data.Text (Text)
import qualified Text.Parsec as Parsec