Skip to content

Instantly share code, notes, and snippets.

View chiroptical's full-sized avatar

Barry Moore II chiroptical

View GitHub Profile
@chiroptical
chiroptical / scratch.u
Created June 26, 2020 20:15
Update code from https://github.com/unisonweb/unison/issues/822 to unison version: devel/M1l-171-g8b57038d
ability State s where
Get : s
Put : s -> ()
runState : s -> Request (State s) a -> (s, a)
runState s = cases
{State.Get -> k} ->
handle k s with runState s
{State.Put s -> k} ->
handle !k with runState s
@chiroptical
chiroptical / scratch.u
Last active July 23, 2020 13:39
Implement the Monoid ability in Unison
ability Semigroup m where
assoc : m -> m -> m
-- Without unique, Monoid and Ask have the same hash
unique ability Monoid m where
identity : m
use Semigroup assoc
use Monoid identity
@chiroptical
chiroptical / InstallationNotes.md
Created August 19, 2020 01:56
Installing neovim with coc.nvim on Ubuntu 20.10 w/ haskell-language-server
  • Update the machine
sudo apt update
sudo apt upgrade
# reboot machine
  • Install prerequisites
@chiroptical
chiroptical / scratch.u
Last active October 11, 2020 02:35
Stack Ability in Unison
-- These are watchers, they run every time we reload this file in Unison repl
> Stack.run Stack.one
> Stack.run Stack.two
> Stack.run Stack.three
Stack.three : '{Stack List Nat} [Nat]
Stack.three = 'let
Stack.put 1
match Stack.pop with
None -> []
all_commands=(
run
run.file
run.pipe
transcript
version
help
-codebase
transcript.fork
)
@chiroptical
chiroptical / abilities.md
Last active October 30, 2020 02:34
A proposal for improving the Unison abilities documentation
title description
Abilities in Unison
Unison's type system tracks which functions can do I/O, and the same language feature, called _abilities_ can be used for many other things, too. This is a tutorial on abilities.

Abilities in Unison

Here are two functions in Unison. One performs I/O (it writes to the console) and so it has an interesting type we'll be explaining much more in this tutorial:

{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE LambdaCase #-}
module Free where
import Control.Monad.Free (Free (..), iterM, liftF)
import qualified Control.Monad.Trans.State as S
safeHead :: [a] -> Maybe a
@chiroptical
chiroptical / commands.sh
Created November 3, 2020 18:13
Installing mpi4py and hdf5 [parallel] on H2P
# The installation below expects that HDF5 is compiled with shared and parallel capabilities
# 1. Load python and mpi libraries
module purge
module load python/3.7.0 venv/wrap openmpi/3.1.4 hdf5/1.10.7
# 2. Make a new virtual environment (or load an existing one)
mkvirtualenv test
workon test
@chiroptical
chiroptical / status.css
Last active November 16, 2020 16:34
CRC Status CSS
table {
width: 100%;
text-align: center;
color: rgb(230 230 230 / 1);
}
table,
th,
td {
border: 1px solid black;
@chiroptical
chiroptical / Meeting-05-08-21.md
Last active May 8, 2021 14:48
Streaming Tools and Functional Programming Hackathon

Participants: chiroptical, jappiejappie

Putting together some initial ideas for the Hackathon

Notes:

  • Primary goal should be learning something new
  • With the new "Stage" channels we can probably just use Discord. This is on-brand because I imagine some of us will work on Discord bots
  • Keep the scope small for the first incarnation, no reason to bite off more than we can chew
    • Choose the cross section of "Streaming Tools" AND "Functional Programming" will keep the scope small
  • That being said, I think it is fine if projects don't fall in this category