Skip to content

Instantly share code, notes, and snippets.

View therewillbecode's full-sized avatar

Tom therewillbecode

  • Edinburgh, UK
View GitHub Profile
@therewillbecode
therewillbecode / post.md
Last active November 26, 2019 16:57
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.

buffers

minibuffer helm mini (launche buffers open and recentfiles

spc b b

move buffer to window n

spc b [n]

erase buffer

spc b e

{-# 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
Code by Petzold
Nand2Tetris
Ben Eater 6502 breadboard project
Computerphile how memory works
https://www.youtube.com/watch?v=XETZoRYdtkw
https://www.youtube.com/watch?v=-Ecf7lb4aZ0

“Worry about data quality: Everything rests on the data.” ― David Spiegelhalter, The Art of Statistics: How to Learn from Data

“What am I not being told? This is perhaps the most important question of all.” ― David Spiegelhalter, The Art of Statistics: How to Learn from Data

“The numbers have no way of speaking for themselves. We speak for them. We imbue them with meaning. — Nate Silver, The Signal and the Noise1” ― David Spiegelhalter, The Art of Statistics: Learning from Data

@therewillbecode
therewillbecode / haskell_exceptions_notes.md
Last active April 25, 2020 13:29
Exceptions in Haskell Notes

Exceptions

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

@therewillbecode
therewillbecode / papers.md
Last active August 30, 2020 08:32
Papers I like
@therewillbecode
therewillbecode / math_insights.md
Last active December 27, 2020 11:21
math_insights

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
therewillbecode / todo.hs
Last active November 11, 2021 14:14
To do List
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,