Skip to content

Instantly share code, notes, and snippets.

@solerf
solerf / typed_errors.md
Created January 16, 2024 09:36 — forked from quelgar/typed_errors.md
Every Argument for Static Typing Applies to Typed Errors

Every Argument for Static Typing Applies to Typed Errors

Think of all the arguments you've heard as to why static typing is desirable — every single one of those arguments applies equally well to using types to represent error conditions.

An odd thing I’ve observed about the Scala community is how many of its members believe that a) a language with a sophisticated static type system is very valuable; and b) that using types for error handling is basically a waste of time. If static types are useful—and if you like Scala, presumably you think they are—then using them to represent error conditions is also useful.

Here's a little secret of functional programming: errors aren't some special thing that operate under a different set of rules to everything else. Yes, there are a set of common patterns we group under the loose heading "error handling", but fundamentally we're just dealing with more values. Values that can have types associated with them. There's absolutely no reason why the benefits of static ty

@solerf
solerf / fish-agent.sh
Created March 14, 2022 22:39 — forked from josh-padnick/fish-agent.sh
Run ssh-agent via fish shell
#!/bin/bash
#
# Convert ssh-agent output to fish shell
#
eval "$(ssh-agent)" >/dev/null
echo "set SSH_AUTH_SOCK \"$SSH_AUTH_SOCK\"; export SSH_AUTH_SOCK"
echo "set SSH_AGENT_PID \"$SSH_AGENT_PID\"; export SSH_AGENT_PID"
@solerf
solerf / xmonad-default-key-bindings.md
Created March 2, 2022 17:19 — forked from micrub/xmonad-default-key-bindings.md
Xmonad default key bindings

xmonad default key bindings

Action key bindings

Key binding Action
mod - shift - slash Run xmessage with a summary of the default keybindings (useful for beginners)
mod - shift - return Launch terminal
mod - p Launch dmenu
mod - shift - p Launch gmrun
@solerf
solerf / intellij-configs.md
Last active January 6, 2020 23:54
Intellij config

Centralized code editor:

Help -> Custom VM options -> -Deditor.distraction.free.mode=true