| environment | |
|---|---|
| OS | ArchLinux |
| Mem | 16GB |
| CPU | intel Core i7 8565U |
$ time node hoge
hello
!
| let reporter ~env ~sw = | |
| let stdout = Eio.Stdenv.stdout env in | |
| let report (type a b) _src _level ~over (k : unit -> b) (msgf : (a, b) Logs.msgf) : b = | |
| let res = Atomic.make None in | |
| let k () = | |
| match Atomic.get res with | |
| | Some v -> v | |
| | None -> | |
| let v = k () in | |
| Atomic.set res (Some v); |
| (executable | |
| (name hoge) | |
| (libraries eio_main domainslib)) |
| #!/usr/bin/env bash | |
| set -eu | |
| from_date=${1:-"2024-10-01"} | |
| to_date=${2:-"2025-03-31"} | |
| total=0 | |
| f() { |
| local eff = require('eff') | |
| local inst, perform, handler = eff.inst, eff.perform, eff.handler | |
| local Twice = inst() | |
| local Exit = inst() | |
| --[[ | |
| co = { | |
| print(1) | |
| coroutine.yield() -- *1 |
| [@@@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 |
| module type NATURAL = sig | |
| type t | |
| val build : ((t -> t) -> t -> t) -> t | |
| end | |
| module type BUILD_NATURAL = functor | |
| (M : sig | |
| type t |
| module Base = struct | |
| type _ operations = .. | |
| end | |
| module Freer : sig | |
| type _ t | |
| module Syntax : sig | |
| val ( let* ) : 'a t -> ('a -> 'b t) -> 'b t | |
| end |
| 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 *) |
| environment | |
|---|---|
| OS | ArchLinux |
| Mem | 16GB |
| CPU | intel Core i7 8565U |
$ time node hoge
hello
!
| \documentclass[landscape,a4paper]{article} | |
| \usepackage{luacode} | |
| \usepackage{pdfpages} | |
| \begin{document} | |
| \begin{luacode*} | |
| local options = [==[ | |
| pages= -, | |
| nup = 2x2, | |
| width = 0.49\paperwidth, |