Skip to content

Instantly share code, notes, and snippets.

@ttesmer
ttesmer / AD.hs
Last active March 19, 2024 03:04
Automatic Differentiation in 38 lines of Haskell using Operator Overloading and Dual Numbers. Inspired by conal.net/papers/beautiful-differentiation
{-# LANGUAGE TypeSynonymInstances #-}
data Dual d = D Float d deriving Show
type Float' = Float
diff :: (Dual Float' -> Dual Float') -> Float -> Float'
diff f x = y'
where D y y' = f (D x 1)
class VectorSpace v where
zero :: v
@igstan
igstan / RecordingApplicative.hs
Last active August 22, 2021 10:17
An Applicative that records the instructions of underlying computations.
{-# LANGUAGE DeriveFunctor #-}
import Control.Applicative
import Control.Monad.Writer
import Control.Monad.Reader
import Control.Monad.Identity
import Data.Map (Map, (!))
import qualified Data.Map as Map
import Data.List (groupBy, intercalate, nub)
import Data.Function (on)
@dvanhorn
dvanhorn / russell.ml
Last active April 23, 2018 14:17
Frege to Russell to OCaml
(* Frege to Russell to OCaml
* Gottlob Frege was a philosopher, logician, and mathematician who is
* widely credited as the father of analytic philoshophy. Around the
* turn of the century he wanted to put mathematics on a rigorous
* foundation. To do so, he invented a programming language called
* axiomatic predicate logic. The basic idea is that you can express
* set theory in this logic. Since much of math can be described in
* terms of set theory, it therefore could be expressed in axiomatic
* predicate logic. If this small core logic could be shown to
@Icelandjack
Icelandjack / OpenKinds.markdown
Last active January 26, 2020 20:53
Rethinking Tricky Classes: Explicit Witnesses of Monoid Actions, Semigroup / Monoid / Applicative homomorphisms
@BaseCase
BaseCase / dc_2017_biblio.md
Last active January 23, 2020 05:13
List of resources recommended or mentioned by the speakers at Deconstruct 2017

Deconstruct 2017 Bibliography

Here are all of the resources mentioned by Deconstruct 2017 speakers, along with who recommended what. Please post a comment if I missed something or have an error!

DC 2017 Speakers' Choice Gold Medalist

  • Seeing Like a State by James Scott

Books

  • Public Opinion by Walter Lippmann (Evan Czaplicki)
  • A Pattern Language by Christopher Alexander (Brian Marick)
  • Domain Driven Design by Eric Evans (Brian Marick)

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@danidiaz
danidiaz / _FP reading lists.md
Last active May 2, 2024 02:00
assorted reading lists

A series of reading lists mostly related to functional programming.

@bishboria
bishboria / springer-free-maths-books.md
Last active April 25, 2024 06:27
Springer made a bunch of books available for free, these were the direct links
@non
non / answer.md
Last active January 9, 2024 22:06
answer @nuttycom

What is the appeal of dynamically-typed languages?

Kris Nuttycombe asks:

I genuinely wish I understood the appeal of unityped languages better. Can someone who really knows both well-typed and unityped explain?

I think the terms well-typed and unityped are a bit of question-begging here (you might as well say good-typed versus bad-typed), so instead I will say statically-typed and dynamically-typed.

I'm going to approach this article using Scala to stand-in for static typing and Python for dynamic typing. I feel like I am credibly proficient both languages: I don't currently write a lot of Python, but I still have affection for the language, and have probably written hundreds of thousands of lines of Python code over the years.

@Vestride
Vestride / encoding-video.md
Last active April 24, 2024 09:59
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus