Skip to content

Instantly share code, notes, and snippets.

View sordina's full-sized avatar

Lyndon Maydwell sordina

View GitHub Profile
import SwiftUI
import PlaygroundSupport
struct Foo : View {
var body: some View {
Circle()
.fill(.green)
.frame(width: 200, height: 200, alignment: .center)
}
* Les: Getting more comfortable with HoTT - Talk: "Bluffers Guide to HoTT"
History - Barber's Paradoxes, etc.
Russell stratifying set theory
Martin Löf in the 1970s
In TT - Say term x is of type t -> `x : t`
This is a judgement
Curry howard - Types and terms = Conjecture/proposition and Proof
Things become interesting in the presence of equality
equality is always with respect to some type
exists t -> x:t = y:t
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeApplications #-}
-- | Small demonstration of GraphQL subscriptions over websockets as per https://github.com/apollographql
--
-- * Intended to be a convention over configuration approach.
-- * Retries subscription on failures.
-- * Provides callbacks for success and errors.
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE ApplicativeDo #-}
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE TypeApplications #-}
import Control.Applicative
import Control.Exception
import Control.Monad
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
-- Wrong!
{-# LANGUAGE DeriveFunctor #-}
module Main where
-- see https://jtobin.io/sorting-with-style
import Control.Arrow ((***))
import Data.Function ((&))
{-# LANGUAGE DeriveFunctor #-}
module Main where
-- see https://jtobin.io/sorting-with-style
import Control.Arrow ((***))
import Data.Function ((&))
{-# LANGUAGE BlockArguments #-}
module Main where
import System.Environment
import Control.Monad
import Control.Concurrent
import Control.Exception.Base
{- Inspiration:
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE FlexibleInstances #-}
-- See also: https://github.com/sordina/non-orthogonal-kd-trees#non-orthogonal-kd-trees
module Main where
import Graphics.Gloss
import Graphics.Gloss.Raster.Field
import System.Random
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE LambdaCase #-}
module Main where
import Data.AttoLisp
import Data.Graph.Inductive.Graph
import Data.Graph.Inductive.PatriciaTree
import Data.GraphViz