Skip to content

Instantly share code, notes, and snippets.

@TerrorJack
TerrorJack / Main.hs
Created December 30, 2022 18:24
Unpacked Maybe type in Haskell
import Maybe
main :: IO ()
main = do
print $ myJust "23333"
print (myNothing :: MyMaybe ())

mold-vs-lld benchmark

This benchmark is conducted by compiling LLVM trunk (781eabeb40b8e47e3a46b0b927784e63f0aad9ab) with:

cmake \
  -Bbuild \
  -Hllvm \
  -DCMAKE_BUILD_TYPE=Debug \
  -DLLVM_CCACHE_BUILD=ON \
#!/usr/bin/env bash
set -euo pipefail
export PATH=~/.cabal/bin:~/.ghcup/bin:~/.local/bin:$PATH
apt update
apt full-upgrade -y
apt install -y \
curl \
OVERVIEW: LLVM Linker
USAGE: ./wasm-ld [options] file...
OPTIONS:
--allow-undefined-file=<value>
Allow symbols listed in <file> to be undefined in linked binary
--allow-undefined Allow undefined symbols in linked binary. This options is equivalent to --import-undefined and --unresolved-symbols=ignore-all
--Bsymbolic Bind defined symbols locally
--check-features Check feature compatibility of linked objects (default)
setInterval(() => window.scrollTo(0, document.body.scrollHeight),1000)
#!/usr/bin/env -S deno run --allow-read --allow-write
import * as flags from "https://deno.land/std@0.160.0/flags/mod.ts";
import * as fs from "https://deno.land/std@0.160.0/fs/mod.ts";
function hash_decomp(p: string) {
const i = p.search(/ [a-f0-9]{32}/);
if (i === -1) {
return [p, null];
}
{-# LANGUAGE RecordWildCards #-}
import qualified Data.ByteString as BS
import Data.Foldable
import Data.Functor
import Data.Maybe
import Data.Set (Set)
import qualified Data.Set as S
import GHC.SysTools.Ar
import System.Environment.Blank
{-# LANGUAGE Strict #-}
import Control.Exception
import Data.Char
import Data.List
import Data.Semigroup
import GHC
( defaultErrorHandler,
getSessionDynFlags,
runGhc,
# libraries/base/GHC/IO/Encoding.hs
################################
################################
# section ""cstring" . base_GHCziIOziEncoding_mkTextEncoding8_bytes" {
# base_GHCziIOziEncoding_mkTextEncoding8_bytes:
# I8[] "//IGNORE"
# }
################################
# section ""cstring" . base_GHCziIOziEncoding_mkTextEncoding6_bytes" {
// DO NOT EDIT!
// Automatically generated by utils/genapply/Main.hs
#include "Cmm.h"
#include "AutoApply.h"
import CLOSURE __stderr_FILE;
stg_ap_p_fast() { // [R1, R2]
I32 _us, _c2, _cg, _ci, _unused;