Skip to content

Instantly share code, notes, and snippets.

@Gabriella439
Gabriella439 / trans.md
Last active November 28, 2023 06:30
I'm trans

I'm writing this post to publicly come out as trans (specifically: I wish to transition to become a woman).

This post won't be as polished or edited as my usual posts, because that's kind of the point: I'm tired of having to edit myself to make myself acceptable to others.

I'm a bit scared to let people know that I'm trans, especially because I'm not yet in a position where I can transition (for reasons I don't want to share, at least not in public) and it's really shameful. However, I'm getting really

@Gabriella439
Gabriella439 / free-will.md
Created June 29, 2022 05:13
Conversation with GPT-3 about free will

Hi, GPT-3. Do you have free will?

Yes, I do have free will.

Prove it.

I can choose to do whatever I want, within the bounds of my abilities.

I mean prove it to me.

@Gabriella439
Gabriella439 / instructions.md
Last active June 22, 2023 19:33
How to reach me on Discord

My Discord handle is: gabriella439

@Gabriella439
Gabriella439 / emotions.md
Created March 8, 2021 19:08
How to get in touch with your emotions

How to get in touch with your emotions

I wanted to share something I've learned in the course of therapy that I felt might benefit others. Specifically, I'd like to share how to better listen to one's emotions.

Why should we do this?

You might wonder why would we want to be in better touch with our emotions. One reason why is that everybody builds a metaphor or narrative for themselves

@Gabriella439
Gabriella439 / typing.md
Last active February 4, 2023 21:15
Sketch of type inference without unification variables

The inference judgment is:

Γ ⊢ e ⇒ A ⊢ Δ

… where:

  • Γ (an input) is a context which is a map from variables to their types
  • e (an input) is an expression whose type we wish to infer
  • A (an output) is the inferred type
  • Δ (an output) is a context which is a map from variables to their types
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
module Example where
import Data.Text (Text)
import GHC.Generics (Generic)
import Dhall (ToDhall)
import Dhall.Diff (Diff)
@Gabriella439
Gabriella439 / default.nix
Last active October 31, 2022 15:37
neovim + haskell-language-server setup
# nix-env --install --file ./default.nix
let
nixpkgs = builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/c473cc8714710179df205b153f4e9fa007107ff9.tar.gz";
sha256 = "0q7rnlp1djxc9ikj89c0ifzihl4wfvri3q1bvi75d2wrz844b4lq";
};
config = {
allowUnfree = true;
};
@Gabriella439
Gabriella439 / MaxiMin.hs
Created August 28, 2022 00:52
MaxiMin algorithm for one player versus uncertainty
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# OPTIONS_GHC -Wall #-}
module MaxiMin where
import Data.List.NonEmpty (NonEmpty(..))
import Data.MemoTrie (HasTrie(..))
@Gabriella439
Gabriella439 / fibonacci.hs
Created March 25, 2018 00:52
Efficient fibonacci numbers using infinite precision integer arithmetic
import Numeric.Natural (Natural)
import qualified Data.Semigroup
-- | @fibonacci n@ computes the @nth@ fibonacci number efficiently using infinite
-- precision integer arithmetic
--
-- Try @fibonacci 1000000@
fibonacci :: Natural -> Natural
fibonacci n = x01 (Data.Semigroup.mtimesDefault n m)
@Gabriella439
Gabriella439 / Main.hs
Created August 18, 2022 00:39
Example async-exception-safe retry function
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Main where
import Control.Concurrent (threadDelay)
import Control.Exception
retry :: Int -> IO a -> IO a
retry n io