Skip to content

Instantly share code, notes, and snippets.

View Skyb0rg007's full-sized avatar
๐Ÿ˜€
Nothin' much

Skye Soss Skyb0rg007

๐Ÿ˜€
Nothin' much
  • University of Chicago
  • Chicago, IL
View GitHub Profile
@Skyb0rg007
Skyb0rg007 / poly-rec.sml
Last active March 4, 2025 21:23
SML/NJ Compiler Bug
datatype 'a nested =
Nest of 'a * 'a list nested
| Epsilon
fun sumListWith f lst = let
fun go ([], acc) = acc
| go (x :: xs, acc) = go (xs, f x + acc)
in
go (lst, 0)
@Skyb0rg007
Skyb0rg007 / _vimrc
Last active February 10, 2025 22:54
Windows Vim Config
" vim: set ft=vim:
" Directory setup: move everything to $APPDATA\Vim and $LOCALAPPDATA\Vim
set backupdir=$LOCALAPPDATA\Vim\backup
set directory=$LOCALAPPDATA\Vim\swap
set undodir=$LOCALAPPDATA\Vim\undo
set viewdir=$LOCALAPPDATA\Vim\view
set viminfofile=$LOCALAPPDATA\Vim\viminfo
set packpath=$APPDATA\Vim,$VIM\vimfiles,$VIMRUNTIME
let g:netrw_home=expand("$LOCALAPPDATA\\Vim")
@Skyb0rg007
Skyb0rg007 / eff-test.hs
Created January 28, 2025 19:28
Different behavior of higher-order effects libraries
#!/usr/bin/env stack
{-
stack script
--resolver lts-22.14
--package freer-simple
--package fused-effects
--package hspec
--package list-t
--package mtl
--package polysemy
{
stdenv,
fetchurl,
lib,
...
}: let
arch = "64";
version = "110.99.6";
baseurl = "http://smlnj.cs.uchicago.edu/dist/working/${version}";
sources = map fetchurl [
@Skyb0rg007
Skyb0rg007 / keybase.md
Created July 15, 2024 19:11
Keybase Proof

Keybase proof

I hereby claim:

  • I am skyb0rg007 on github.
  • I am ssoss (https://keybase.io/ssoss) on keybase.
  • I have a public key ASCAT7BWiVK3mLDaoyVI7mN9srBI3lMk-eIkkKGKSMEv6wo

To claim this, I am signing this object:

<#PSScriptInfo
.VERSION 1.0
.GUID dadcf7db-a1ab-4360-b66b-25d5e7a1666a
.AUTHOR [email protected]
.COPYRIGHT Skye Soss 2024
@Skyb0rg007
Skyb0rg007 / day1.fs
Created December 1, 2022 06:17
Advent of Code 2022
CREATE top3 3 CELLS ALLOT top3 3 CELLS 0 FILL
0 VALUE file
12 CONSTANT max-line
CREATE line-buffer max-line ALLOT
: init-file ( -- ) S" day1.txt" R/O OPEN-FILE THROW TO file ;
: free-file ( -- ) file CLOSE-FILE THROW 0 TO file ;
: step ( -- u f ) line-buffer max-line 2 - file READ-LINE THROW ;
@Skyb0rg007
Skyb0rg007 / Composition.hs
Last active November 15, 2022 17:21
Files for the PL presentation on (free) monads
#!/usr/bin/env stack
-- stack script --resolver lts-19.30
{-# LANGUAGE GADTs, ViewPatterns, ScopedTypeVariables, InstanceSigs, MultiParamTypeClasses, DeriveFunctor, StandaloneDeriving, UnicodeSyntax, ImportQualifiedPost #-}
import Control.Applicative (liftA2)
import Control.Monad (join)
import Data.Proxy (Proxy (Proxy))
--
local
structure Cont = SMLofNJ.Cont
structure IntervalTimer = SMLofNJ.IntervalTimer
structure S = Signals
in
(* `withTimeout t f` calls `f ()` and returns `SOME x` where `x` is the result of the function call.
* If `f ()` takes longer than `t` to execute, `withTimeout` instead returns `NONE` *)
fun withTimeout t f =
let
val result = ref NONE
#!/usr/bin/env stack
-- stack script --resolver lts-18.18
module Main (main) where
import Control.Applicative (liftA2)
import Control.Comonad (extract)
import Control.Comonad.Cofree (Cofree ((:<)))
import Control.Monad (forM_)
import Control.Monad.ST (runST)