Skip to content

Instantly share code, notes, and snippets.


Tom therewillbecode

  • Edinburgh, UK
View GitHub Profile

Number theory

Primes are the atoms of the integers.

Fundamental theorem of arithmetic

Absolute values and inequalities

Remember to flip inequalities when taking the reciprocal of both sides or multiplying/diving both sides by a negative.

therewillbecode /
Last active Jun 13, 2020
Generics Seminar Zurihac Notes -2020

Generics Seminar

Generics are about sitting between a nominal and structural view of types.

Parametric Polymorphism Vs Types Classes Vs Generics

Parametric Polymorpishm - says behave on all types in exactly same way

on the other hand typeclasses is an interface which behaves differently depending on the type

Generics are in between the two extremes

therewillbecode /
Last active Apr 25, 2020
Exceptions in Haskell Notes


All code that runs in IO can experience exceptions of any type.

Remember you can only catch an exception in IO. But it is possible to throw exceptions from pure code. An example of this is error.

Throw doesn't throw until forced

Due to laziness the order of evaluation of expressions can be modified by the compiler. This means that throw can return an

View gist:736efa318fb6874956e92cbc87c32483
Code by Petzold
Ben Eater 6502 breadboard project
Computerphile how memory works
View gist:fea4a5c2437ea5b15018c4860cf5ba07
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
module Socket.Table where
import Control.Concurrent hiding ( yield )
import Control.Concurrent.Async
import Control.Concurrent.STM
import qualified Data.Map.Lazy as M
import Database.Persist.Postgresql
import qualified Network.WebSockets as WS


minibuffer helm mini (launche buffers open and recentfiles

spc b b

move buffer to window n

spc b [n]

erase buffer

spc b e

therewillbecode /
Last active Nov 26, 2019
Modelling the World of Blade Runner with Haskell's Type System

alt text

If you are starting your Haskell journey I implore you to focus on the type system.

Types are the roots from which your Haskell knowledge grows.

Haskell has algebraic data types. This is a fancy way of saying that we can create types which are composites of other types. Intuitively we can think of types as sets of values.