Skip to content

Instantly share code, notes, and snippets.

@runarorama
runarorama / gist:8c096fc1ff6472a5d1141903c4a45187
Created July 21, 2020 09:18
GPT-3 NYT interview with Ayn Rand
Everything after the first "Ayn Rand:" is generated by GPT-3.
----
The New York Times sat down with Ayn Rand to discuss her philosophy of Objectivism.
New York Times: Miss Rand, could you give us a brief summary of your philosophy?
Ayn Rand: The name of my philosophy is Objectivism. As I see it, the purpose of philosophy is to provide man with a comprehensive world view by answering three basic questions:
CombineEstimates[es_] := Module[{result, ds, var, tvals, newe, t},
(*Gets the standard deviation for a confidence interval `e`.*)
Deviation[e_,
confidence_] := (Max[e] -
Min[e])/(InverseCDF[NormalDistribution[], confidence]*2);
(*Gets the confidence for an interval given its standard
deviation.*)
Confidence[e_, dev_] :=

Unison 2021 year in review

2021 was a big year for Unison. We released a new alpha version roughly every other month, and each release came with some serious improvements. In total, we merged more than 600 pull requests, 48 of which were from the open-source community.

Here are some of the highlights.

A beautiful GUI for browsing the Unison codebase

Since a Unison codebase is not stored in text files, it's been a sticking point for developers that they haven't been able to easily browse their code and post it online for others to see. So this summer we rolled out a new user interface for browsing the Unison codebase through a web browser. This comes embedded in the Codebase Manager, so now when you start up ucm it also starts a local web server that lets you browse and search your code in a delightful way.

@runarorama
runarorama / gist:a933af7794ae40d103231a65652314db
Created June 30, 2021 19:32
Arbitrary-precision naturals in Unison
unique type Natural
= Natural (Nonempty Nat)
List.Nonempty.appendList : Nonempty a -> [a] -> Nonempty a
List.Nonempty.appendList = cases
Nonempty a as ->
use List ++
bs -> Nonempty a (as ++ bs)
List.dropRightWhile : (a ->{g} Boolean) -> [a] ->{g} [a]
@runarorama
runarorama / gist:a8fab38e473fafa0921d
Last active April 13, 2021 22:28
Compositional application architecture with reasonably priced monads
sealed trait Interact[A]
case class Ask(prompt: String)
extends Interact[String]
case class Tell(msg: String)
extends Interact[Unit]
trait Monad[M[_]] {
def pure[A](a: A): M[A]
You, Who Hold the Fire in Your Heart - Davíð Stefánsson, 1919
You, who hold the fire in your heart,
unhesitant and brave you go
into the abyssal, black darkness,
like a noble hero.
- The bright glow always beams
from the innovator's sacred ember.
Your words, they blaze, and all your blood;
@runarorama
runarorama / definitions.json
Created January 9, 2021 01:49
getDefinition output
{
"typeDefinitions": [
[{
"tag": "ShortHash",
"prefix": "jk39javgi28eog9lmpblqeg6eb6dkv9f2eo1kauceki0h7g0t9tbg2oi3u4qioa5d0mioptr5548049odbuv9tg34s6foqs26hf1feg",
"cycle": null,
"cid": null
}, {
"tag": "UserObject",
"contents": [{
@runarorama
runarorama / list2.js
Last active December 19, 2020 02:45
base.list listing
{"namespaceListingChildren":[{"tag":"TermObject","contents":{"termName":"++","termHash":"##List.++","termType":[{"annotation":{"tag":"DelimiterChar"},"segment":"["},{"annotation":{"tag":"Var"},"segment":"a"},{"annotation":{"tag":"DelimiterChar"},"segment":"]"},{"annotation":null,"segment":" "},{"annotation":{"tag":"TypeOperator"},"segment":"->"},{"annotation":null,"segment":" "},{"annotation":{"tag":"DelimiterChar"},"segment":"["},{"annotation":{"tag":"Var"},"segment":"a"},{"annotation":{"tag":"DelimiterChar"},"segment":"]"},{"annotation":null,"segment":" "},{"annotation":{"tag":"TypeOperator"},"segment":"->"},{"annotation":null,"segment":" "},{"annotation":{"tag":"DelimiterChar"},"segment":"["},{"annotation":{"tag":"Var"},"segment":"a"},{"annotation":{"tag":"DelimiterChar"},"segment":"]"}]}},{"tag":"TermObject","contents":{"termName":"at","termHash":"##List.at","termType":[{"annotation":{"tag":"Reference","contents":{"tag":"Builtin","contents":"Nat"}},"segment":"Nat"},{"annotation":null,"segment":" "},{"anno
@runarorama
runarorama / list.js
Created December 19, 2020 02:36
Namespace Listing
{"namespaceListingChildren":[{"tag":"TermObject","contents":{"termName":"bug","termHash":"##bug","termType":[{"annotation":{"tag":"Var"},"segment":"a"},{"annotation":null,"segment":" "},{"annotation":{"tag":"TypeOperator"},"segment":"->"},{"annotation":null,"segment":" "},{"annotation":{"tag":"Var"},"segment":"b"}]}},{"tag":"TermObject","contents":{"termName":"todo","termHash":"##todo","termType":[{"annotation":{"tag":"Var"},"segment":"a"},{"annotation":null,"segment":" "},{"annotation":{"tag":"TypeOperator"},"segment":"->"},{"annotation":null,"segment":" "},{"annotation":{"tag":"Var"},"segment":"b"}]}},{"tag":"TermObject","contents":{"termName":".","termHash":"#0hoa6tis7604fo17o91lfjflsvd843uvm7sueu5rfqqn5nbneajoh9fldfbmmjnhh1h2690ktfflrbb96q9lksesuh3t5amcc1ph92g","termType":[{"annotation":null,"segment":"("},{"annotation":{"tag":"Var"},"segment":"b"},{"annotation":null,"segment":" "},{"annotation":{"tag":"TypeOperator"},"segment":"->"},{"annotation":{"tag":"AbilityBraces"},"segment":"{"},{"annotation":{"tag
{"namespaceListingChildren":[{"tag":"TermObject","contents":{"termName":"bug","termHash":"##bug","termType":[{"annotation":{"tag":"Var"},"segment":"a"},{"annotation":null,"segment":" "},{"annotation":{"tag":"TypeOperator"},"segment":"->"},{"annotation":null,"segment":" "},{"annotation":{"tag":"Var"},"segment":"b"}]}},{"tag":"TermObject","contents":{"termName":"todo","termHash":"##todo","termType":[{"annotation":{"tag":"Var"},"segment":"a"},{"annotation":null,"segment":" "},{"annotation":{"tag":"TypeOperator"},"segment":"->"},{"annotation":null,"segment":" "},{"annotation":{"tag":"Var"},"segment":"b"}]}},{"tag":"TermObject","contents":{"termName":".","termHash":"#0hoa6tis7604fo17o91lfjflsvd843uvm7sueu5rfqqn5nbneajoh9fldfbmmjnhh1h2690ktfflrbb96q9lksesuh3t5amcc1ph92g","termType":[{"annotation":null,"segment":"("},{"annotation":{"tag":"Var"},"segment":"b"},{"annotation":null,"segment":" "},{"annotation":{"tag":"TypeOperator"},"segment":"->"},{"annotation":{"tag":"AbilityBraces"},"segment":"{"},{"annotation":{"tag