- Update the machine
sudo apt update
sudo apt upgrade
# reboot machine
- Install prerequisites
| 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 |
| 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 |
sudo apt update
sudo apt upgrade
# reboot machine
| -- 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 | |
| ) |
| 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. |
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 |
| # 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 |
| table { | |
| width: 100%; | |
| text-align: center; | |
| color: rgb(230 230 230 / 1); | |
| } | |
| table, | |
| th, | |
| td { | |
| border: 1px solid black; |
Participants: chiroptical, jappiejappie
Putting together some initial ideas for the Hackathon
Notes: