Skip to content

Instantly share code, notes, and snippets.


Tom therewillbecode

  • Edinburgh, UK
View GitHub Profile
View typeerror.hs
import Hedgehog hiding (Action)
data GPlayers (v :: * -> *) = GPlayers (Vector (Var [Action] v)) deriving (Eq, Ord, Show)
data GToAct (v :: * -> *) = GToAct (Var (Maybe Int) v) deriving (Eq, Ord, Show)
data GModel (v :: * -> *) = GModel (GPlayers v) (GToAct v) deriving (Eq, Ord, Show)
initialModel :: forall (v :: * -> *) . GModel v
View machines.hs
module Main where
import Lib
import Data.Char
import Data.Machine
-- newtype CurrPlayerToAct = CurrPlayerToAct String deriving (Eq, Show, Ord)
View todo.hs
data User = User { email :: Text }
newtype TodoList = TodoList ([UTCTime, Map TodoId Todo])
newtype UserLists = UserLists (Map Email [TodoList])
newtype TodoId = TodoId Int
data Todo = Todo
{ description :: Description,

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