Skip to content

Instantly share code, notes, and snippets.

View vic's full-sized avatar
🐢
turtles all the way up

Victor Borja vic

🐢
turtles all the way up
View GitHub Profile
@vic
vic / README.md
Last active July 1, 2025 21:35
fx-rs

Composable Effectful Computations in Rust: Integrating Algebraic Effects, Lenses, and Contextual Adaptation

fx-rs: An algebraic effects system for Rust.

Abstract

Effect systems have become a powerful tool for structuring modular, composable, and type-safe effectful computations. While algebraic effects and handlers have seen widespread adoption in languages like Haskell and OCaml, their integration in Rust remains limited. We present Fx, a novel effect system for Rust that unifies algebraic effects, lenses, and contextual adaptation in a single, extensible abstraction. Fx enables ergonomic composition of effectful computations, modular interpretation via handlers, and fine-grained state manipulation using lenses. We demonstrate how Fx supports advanced patterns such as context adaptation and effectful accumulation, and evaluate its expressiveness and ergonomics through practical examples. Our work shows that Rust’s type system and ownership model can support advance

@vic
vic / flake.nix
Last active February 26, 2025 04:37
example flake with overlays
{
outputs = inputs: {
overlays.foo = final: prev: {
foo = final.writeShellScriptBin "foo" "echo FOO";
};
overlays.moo = final: prev: {
moo = final.writeShellScriptBin "moo" "echo MOO";
};
};
@vic
vic / 2023-12-03.zig
Created December 5, 2023 18:57
AdventOfCode 2023 Day03 in Zig
const std = @import("std");
const Allocator = std.mem.Allocator;
const ConstantInput = *const []const u8;
const NumIdx = struct {
fromIdx: usize,
toIdx: usize,
pub fn text(self: NumIdx, input: ConstantInput) []const u8 {
@vic
vic / jitpack.yml
Created August 8, 2023 09:50
scala-cli gh-actions
before_install:
- curl -o scala-cli https://raw.githubusercontent.com/VirtusLab/scala-cli/main/scala-cli.sh
- chmod +x scala-cli
install:
- |
./scala-cli --power publish --publish-repository $HOME/.m2/repository --organization "$GROUP" --name "$ARTIFACT" --version "$VERSION" .
ls -R $HOME/.m2/repository/
find $HOME/.m2/repository -type f -name "*.pom" -exec cp -v {} $PWD \;
import mill._
trait BuildrModule extends Module {
def logger = {
val colors = interp.colors()
new mill.util.PrintLogger(
colors != ammonite.util.Colors.BlackWhite,
false,
colors.info(),
import com.raquo.airstream.flatten.FlattenStrategy
import com.raquo.laminar.api.L._
import com.raquo.laminar.nodes.ReactiveElement
import com.raquo.laminar.nodes.ReactiveHtmlElement
import scala.util.Failure
import scala.util.Success
import scala.util.Try
import org.scalajs.dom
@vic
vic / SlothMux.sc
Created December 9, 2021 23:54
An Scala RPC API using Sloth (with binary Boopickle serialization) and Twitter Finagle Mux as transport.
/**
* Usage:
*
* ammonite SlothMux.sc runServer
*
* ammonite SlothMux.sc runClient
*/
import $ivy.`io.catbird::catbird-finagle:21.8.0`
import $ivy.`com.twitter::finagle-mux:21.8.0`
@vic
vic / gist:1f2dc6201cbe55b358c9c29f2af39851
Created July 1, 2020 20:08
Mill not generating sourcemaps when using scalajs >= 1.
❯ ./mill scalajslib.test 'mill.scalajslib.HelloJSWorldTests.fastOpt'
[94/356] scalajslib.worker[1].compile
[info] Compiling 1 Scala source to /h/mill/out/scalajslib/worker/1/compile/dest/classes ...
[warn] 1 deprecation (since 2.13.0); re-run with -deprecation for details
[warn] one warning found
[info] Done compiling.
[221/356] main.core.compile
[info] Compiling 1 Scala source to /h/mill/out/main/core/compile/dest/classes ...
[info] Done compiling.
[356/356] scalajslib.test.test

Keybase proof

I hereby claim:

  • I am vic on github.
  • I am oeiuwq (https://keybase.io/oeiuwq) on keybase.
  • I have a public key ASDl3QUhn_Iv58GAMXdWpgBTMfK7AB_NVO7Kfd37fv2zPgo

To claim this, I am signing this object:

@vic
vic / README.md
Last active April 3, 2018 05:54
Rebecca iterm2 colors

Install d12frosted/emacs-plus on mac patched for rich colors on terminals supporting direct color (like iterm2).

brew install emacs-plus --with-24bit-color

Generate the terminfo (see attached .src file)

Then run emacs/emacsclient with TERM set to xterm-24bits