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
Nothing :: struct {} | |
Just :: struct($T: typeid) { | |
value: T, | |
} | |
Maybe :: union($T: typeid) { | |
Nothing, | |
Just(T), | |
} |
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
local M = {} | |
local erl_call = "erl -noshell -sname neovim -eval" | |
M.beam_dev_helper_rpc = function(node, module, function_name) | |
return "rpc:call(" .. node .. ", " .. module .. ", " .. function_name .. ", []), halt(0)." | |
end | |
M.execute_erlang_rpc_call = function(node, module, function_name) | |
local command = erl_call .. " \"" .. M.beam_dev_helper_rpc(node, module, function_name) .. "\"" |
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
startLink :: Arguments -> Effect (StartLinkResult (Process Message)) | |
startLink arguments = do | |
SimpleServer.startLink arguments { init, handleInfo, name: Nothing } | |
init :: Arguments -> ProcessM Message (InitValue State) | |
init { socket } = do | |
self' <- Process.self | |
liftEffect $ Process.send self' ReadRequest | |
pure $ SimpleServer.initOk { socket, prices: MapSet.empty } |
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
FROM fpco/stack-build:lts-16.31 | |
RUN apt update && apt install -y inotify-tools | |
RUN stack --resolver lts-16.31 install yesod-bin | |
RUN stack --resolver lts-16.31 install ormolu | |
RUN stack --resolver lts-16.31 install hlint |
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
" zig ALE linter by fubd @ FreeNode | |
" Author: Kevin Watters <[email protected]> | |
" Description: This file adds support for checking zig code. | |
" | |
let g:ale_lint_on_text_changed = 'never' | |
let g:ale_zig_compiler = "zig" | |
function! ZigGetExecutable(buffer) abort | |
return g:ale_zig_compiler |
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
// c version: | |
// #include <erl_nif.h> | |
// static ERL_NIF_TERM hello(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]) | |
// { | |
// return enif_make_string(env, "Hello World!", ERL_NIF_LATIN1); | |
// } | |
// static ErlNifFunc nif_funcs[] = {"hello", 0, hello}; |
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
// c version: | |
// #include <erl_nif.h> | |
// static ERL_NIF_TERM hello(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]) | |
// { | |
// return enif_make_string(env, "Hello World!", ERL_NIF_LATIN1); | |
// } | |
// static ErlNifFunc nif_funcs[] = {"hello", 0, hello}; |
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
// c version: | |
// #include <erl_nif.h> | |
// static ERL_NIF_TERM hello(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]) | |
// { | |
// return enif_make_string(env, "Hello World!", ERL_NIF_LATIN1); | |
// } | |
// static ErlNifFunc nif_funcs[] = {"hello", 0, hello}; |
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
interface PlainText extends String { | |
__plaintext__: never | |
} | |
interface Base64Encoded extends String { | |
__base64Encoded__: never | |
} | |
interface Encrypted extends String { | |
__encrypted__: never | |
} |
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
defmodule Consumer.Subscriptions do | |
def start_link do | |
Agent.start_link(fn -> %{} end, name: __MODULE__) | |
end | |
def get_subscribers(topic) do | |
Agent.get(__MODULE__, fn map -> Map.get(map, topic, []) end) | |
end | |
def add_subscription(sub, topic) do |
NewerOlder