Skip to content
unison logo

Unison

unison

Unison language - content-addressed functional programming with abilities for effects, distributed computing, and structural types. Use for pure functional code, effect management, distributed systems, and refactoring-safe codebases.

plurigrid/asi0installs67stars

SKILL.md

Full skill instructions

Unison

Content-addressed functional programming language with first-class effects.

Key Concepts

ConceptDescription
Content-addressedCode identified by hash, not name - renames are free
AbilitiesAlgebraic effects for IO, Exception, Random, Remote
Structural typesTypes with same structure are identical
UCMUnison Codebase Manager - REPL + version control

UCM Commands

# Start UCM
ucm

# Start with specific project
ucm -p myproject/​main

# Run compiled program
ucm run.compiled program.uc

# Create codebase at path
ucm -C ./​my-codebase

Inside UCM REPL

# Project management
project.create myproject
switch myproject/​main

# Add code from scratch file
update
add

# Run a function
run helloWorld

# Compile to executable
compile helloWorld output

# Install library from Share
lib.install @unison/​http

# Find definitions
find : Text -> Nat
find map

# View definition
view List.map

# Documentation
docs List.map

# Refactoring (rename is instant!)
move.term oldName newName

Syntax Quick Reference

Functions

-- Type signature
double : Nat -> Nat
double x = x * 2

-- Multi-argument
add : Nat -> Nat -> Nat
add x y = x + y

-- Lambda
List.map (x -> x * 2) [1, 2, 3]

-- Pipeline operator
[1, 2, 3] |> List.map (x -> x * 2) |> List.filter Nat.isEven

Delayed Computations (Thunks)

-- Three equivalent ways to delay
main : '{IO, Exception} ()
main = do printLine "hello"

main : '{IO, Exception} ()
main _ = printLine "hello"

main : '{IO, Exception} ()
main = '(printLine "hello")

-- Force with ! or ()
!main
main()

Pattern Matching

-- Match expression
isEven num = match num with
  n | mod n 2 === 0 -> "even"
  _ -> "odd"

-- Cases shorthand
isEven = cases
  0 -> "zero"
  n | Nat.isEven n -> "even"
  _ -> "odd"

-- As-patterns with @
match Some 12 with
  opt@(Some n) -> "opt binds whole value"
  None -> "none"

Types

-- Sum type (unique by name)
type LivingThings = Animal | Plant | Fungi

-- Recursive type with parameter
structural type Tree a = Empty | Node a (Tree a) (Tree a)

-- Record type (generates accessors)
type Pet = { age: Nat, species: Text, foods: [Text] }

-- Use generated accessors
Pet.age : Pet -> Nat
Pet.age.set : Nat -> Pet -> Pet
Pet.age.modify : (Nat -> Nat) -> Pet -> Pet

Lists

-- Literals
[1, 2, 3]

-- Concatenation
[1, 2] List.++ [3, 4]

-- Cons/​snoc
use List +: :+
1 +: [2, 3]     -- [1, 2, 3]
[1, 2] :+ 3    -- [1, 2, 3]

-- Transformations
Nat.range 0 10
  |> List.map (x -> x * 100)
  |> List.filter Nat.isEven
  |> List.foldLeft (+) 0

Text

-- Filter and split
Text.filter isDigit "abc_123_def" |> Text.split ?0
-- ["1", "2", "3"]

-- Pattern matching (regex-like)
Pattern.run (Pattern.capture (Pattern.many (chars "ab"))) "aabb123"
-- Some (["aabb"], "123")

Abilities (Effects)

Abilities are Unison's approach to algebraic effects:

-- Function using abilities
getRandomElem : [a] ->{Abort, Random} a
getRandomElem list =
  index = natIn 0 (List.size list)
  List.at! index list

-- Handle with splitmix (Random) and toOptional (Abort)
toOptional! do splitmix 42 do getRandomElem [1, 2, 3]

Common Abilities

AbilityPurposeHandler
IOFile, network, consoleRuntime
ExceptionRaise/​catch errorscatch, toEither
RandomRandom number generationsplitmix seed
AbortEarly terminationtoOptional!
RemoteDistributed computationCloud runtime
STMSoftware transactional memorySTM.atomically

Exception Handling

nonZero : Nat ->{Exception} Nat
nonZero = cases
  0 -> Exception.raise (Generic.failure "Zero found" 0)
  n -> n

-- Catch returns Either
catch do nonZero 0
-- Left (Failure ...)

catch do nonZero 5
-- Right 5

Distributed Computing

forkedTasks : '{Remote} Nat
forkedTasks = do
  task1 = Remote.fork here! do 1 + 1
  task2 = Remote.fork here! do 2 + 2
  Remote.await task1 + Remote.await task2

Concurrency (STM)

type STM.TQueue a = TQueue (TVar [a]) (TVar Nat)

TQueue.enqueue : a -> TQueue a ->{STM} ()
TQueue.enqueue a = cases
  TQueue elems _ -> TVar.modify elems (es -> a +: es)

-- Atomic block
result = STM.atomically do
  queue = TQueue.fromList [1, 2, 3]
  TQueue.enqueue 4 queue
  TQueue.dequeue queue

File Operations

-- Read file
content = readFileUtf8 (FilePath "data.txt")

-- Write file
FilePath.writeFile (FilePath "out.txt") (Text.toUtf8 "hello")

-- Rename
renameFile (FilePath "old.txt") (FilePath "new.txt")

HTTP (with @unison/​http)

myproject/​main> lib.install @unison/​http
exampleGet : '{IO, Exception, Threads} HttpResponse
exampleGet _ =
  uri = net.URI.parse "https://example.com/​api"
  req = do Http.get uri
  Http.run req

Hello World

-- In scratch.u file
helloWorld : '{IO, Exception} ()
helloWorld = do printLine "Hello World"
scratch/​main> project.create hello-world
hello-world/​main> update
hello-world/​main> run helloWorld

-- Or compile to binary
hello-world/​main> compile helloWorld hello
$ ucm run.compiled hello.uc

Workflow

  1. Write code in any .u file (scratch file)
  2. UCM auto-watches and typechecks
  3. Use update or add to add to codebase
  4. Code stored by hash - refactoring is instant
  5. Share via Unison Share (push, pull)

GF(3) Integration

PhaseTritUnison Pattern
Validate-1Exception, Abort abilities
Coordinate0STM, handlers, pipelines
Generate+1Remote.fork, IO effects

Skill Name: unison
Type: Functional Programming Language
Trit: 0 (ERGODIC - coordination via abilities)
Version: 0.5.49
Platform: Cross-platform (ucm binary)

Scientific Skill Interleaving

This skill connects to the K-Dense-AI/​claude-scientific-skills ecosystem:

Graph Theory

  • networkx [○] via bicomodule
    • Universal graph hub

Bibliography References

  • general: 734 citations in bib.duckdb

Cat# Integration

This skill maps to Cat# = Comod(P) as a bicomodule in the equipment structure:

Trit: 0 (ERGODIC)
Home: Prof
Poly Op: ⊗
Kan Role: Adj
Color: #26D826

GF(3) Naturality

The skill participates in triads satisfying:

(-1) + (0) + (+1) ≡ 0 (mod 3)

This ensures compositional coherence in the Cat# equipment structure.

More skills from plurigrid

cargo logo
plurigrid/asi

cargo

Rust package manager (36 subcommands).

67 0
View

Translate Figma nodes into production-ready code with 1:1 visual fidelity using the Figma MCP workflow (design context, screenshots, assets, and project-convention translation). Trigger when the user provides Figma URLs or node IDs, or asks to implement designs or components that must match Figma...

67 0
View

**Status**: 🌳 Production Ready (upstream in StringZilla v3+) **Type**: High-Performance String Operations / SIMD-Accelerated Text Processing **Principle**: Zero-copy views, SIMD/SWAR acceleration, deterministic hashing **Frame**: Cross-language interoperability (C, C++, Python, Rust, Go, Swift, ...

67 0
View
conformal-ga logo
plurigrid/asi

conformal-ga

Conformal Geometric Algebra (CGA) for circles, spheres, and Möbius transformations

67 0
View

Verifies code implements exactly what documentation specifies for blockchain audits. Use when comparing code against whitepapers, finding gaps between specs and implementation, or performing compliance checks for protocol implementations.

67 0
View
zig-systems logo
plurigrid/asi

zig-systems

Systems programming and performance optimization using Zig. Provides low-level abstractions, memory-safe compiled code, and performance benchmarking. Use for system-level operations, optimization, and interoperability with C/POSIX APIs.

67 0
View
paypal-mcp logo
plurigrid/asi

paypal-mcp

PayPal MCP server integration for invoices, payments, subscriptions, disputes, and transaction reporting via @paypal/mcp.

67 0
View
tasks-acset logo
plurigrid/asi

tasks-acset

Google Tasks management via TasksACSet. Transforms task operations into GF(3)-typed Interactions, routes to triadic queues, detects saturation for task-zero-as-condensed-state.

67 0
View
c logo
plurigrid/asi

c

World C Skill

67 0
View
syrup logo
plurigrid/asi

syrup

Syrup binary serialization for OCapN/CapTP wire format. Canonical encoding for capability messages.

67 0
View
skill-installer logo
plurigrid/asi

skill-installer

Install Codex skills into $CODEX_HOME/skills from a curated list or a GitHub repo path. Use when a user asks to list installable skills, install a curated skill, or install a skill from another repo (including private repos).

67 0
View
cloudflare-workers logo
plurigrid/asi

cloudflare-workers

Deploy serverless applications on Cloudflare Workers. Covers project setup, JavaScript handler patterns, routing, deployment with Wrangler, and API token configuration. Suitable for APIs, proxies, edge computing, and request transformation.

67 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View