Instantly share code, notes, and snippets.

⚜️

# Nymphium Nymphium

⚜️

Last active February 8, 2023 14:21
View main.ml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 [@@@alert "-unstable"] [@@@warning "-32"] (* Reimplementation of Go's worker pools using Eio and Domainslib.Chan https://gobyexample.com/worker-pools *) module Stdenv = struct type _ Effect.t += Get : (Eio.Stdenv.t * Eio.Switch.t) Effect.t
Created October 19, 2020 05:11
View natural_builder.ml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 module type NATURAL = sig type t val build : ((t -> t) -> t -> t) -> t end module type BUILD_NATURAL = functor (M : sig type t
Last active September 29, 2020 05:42
View freer_ext2.ml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 module Base = struct type _ operations = .. end module Freer : sig type _ t module Syntax : sig val ( let* ) : 'a t -> ('a -> 'b t) -> 'b t end
Created August 24, 2020 18:34
View hoge.ml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 module type S = sig val x: int end let module M = struct let x = 3 end in Obj.magic (module M : S) |> fun m -> let module M = (val m : S) in M.x (* 3 *)
Last active May 7, 2020 17:33
View result.md
environment
OS ArchLinux
Mem 16GB
CPU intel Core i7 8565U
$time node hoge hello !  Created February 6, 2020 06:53 View pagination.tex This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters  \documentclass[landscape,a4paper]{article} \usepackage{luacode} \usepackage{pdfpages} \begin{document} \begin{luacode*} local options = [==[ pages= -, nup = 2x2, width = 0.49\paperwidth, Created February 5, 2020 07:16 View test.lua This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters  function() return error() endlocal socket = require('socket') local gettime = socket.gettime local TIMES = 1000000 local t1 = gettime() for _ = 1, TIMES do pcall(error) end local t2 = gettime() Created January 30, 2020 17:33 View countier.ml This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters  let run_continuer : type a. ((unit -> (unit -> a)) -> a) -> a = fun f -> let module M = struct effect Save : unit -> (unit -> a);; let save () = perform @@ Save () end in let open M in match f save with | effect (Save ()) k -> Created January 22, 2020 15:56 View toggle.lua This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters  awful.key({ modkey }, 't', function() local w = {} for _, c in ipairs(filter_ddt(get_tag_clients())) do local str = ('/tmp/%s.png'):format(tostring{}:match('0x([0-f]+)')) gears.surface(c.content):write_to_png(str) local font_orig = beautiful.font:match('^(.*) %d+$') local font_size = 14 local font = ('%s %d'):format(font_orig, font_size)
Last active January 9, 2020 06:58
View shallow-effect-handler.rkt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 #lang racket (require racket/control) (struct spwn (val p) #:prefab #:extra-name Spwn) (define (fcontrol-at p v) (fcontrol (spwn v p))) (define (%-at p th handler)