Skip to content

Instantly share code, notes, and snippets.

import S from 'sanctuary';
import Identity from 'sanctuary-identity';
// lens :: (s -> a) -> (a -> s -> s) -> Lens s a
const lens = getter => setter => f => s => (
S.map (v => setter (v) (s))
(f (getter (s)))
);
Title:
Incident date:
Owner:
Peer-review committee:
Tags:
Summary:
Supporting data:
Customer Impact:
Incident Response Analysis:
Post-Incident Analysis:

Introduction

I was recently asked to explain why I felt disappointed by Haskell, as a language. And, well. Crucified for crucified, I might as well criticise Haskell publicly.

First though, I need to make it explicit that I claim no particular skill with the language - I will in fact vehemently (and convincingly!) argue that I'm a terrible Haskell programmer. And what I'm about to explain is not meant as The Truth, but my current understanding, potentially flawed, incomplete, or flat out incorrect. I welcome any attempt at proving me wrong, because when I dislike something that so many clever people worship, it's usually because I missed an important detail.

Another important point is that this is not meant to convey the idea that Haskell is a bad language. I do feel, however, that the vocal, and sometimes aggressive, reverence in which it's held might lead people to have unreasonable expectations. It certainly was my case, and the reason I'm writing this.

Type classes

I love the concept of type class

@lfjeff
lfjeff / serve_s3_images_from_own_domain.js
Created June 11, 2018 03:09
Serve S3 images from your own domain using Cloudflare worker
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
/**
* When we receive a request, fetch it from our S3 bucket
*
* For example, a request for:
* https://mydomain.com/images/castle01.jpg
* will be fetched from:
@uraimo
uraimo / dnsovertls.md
Last active March 22, 2024 20:55
Configure your Mac to use DNS over TLS
@dalanmiller
dalanmiller / Dockerfile.app
Last active June 29, 2020 15:27
RethinkDB docker-compose.yml example
IMAGE node:argon
RUN mkdir -p /usr/app
COPY . /usr/app
WORKDIR /usr/app
RUN npm install
@thurask
thurask / transmission_tracker.py
Created July 12, 2016 17:21
Add trackers to all torrents in Transmission
import argparse
import subprocess
import sys
def do(id, tracker):
subprocess.call(["transmission-remote", "-t", id, "-td", tracker])
def get():
q = subprocess.check_output(["transmission-remote", "-l"])
w = q.split("\n")[1:]
@Avaq
Avaq / combinators.js
Last active May 1, 2024 09:38
Common combinators in JavaScript
const I = x => x
const K = x => y => x
const A = f => x => f (x)
const T = x => f => f (x)
const W = f => x => f (x) (x)
const C = f => y => x => f (x) (y)
const B = f => g => x => f (g (x))
const S = f => g => x => f (x) (g (x))
const S_ = f => g => x => f (g (x)) (x)
const S2 = f => g => h => x => f (g (x)) (h (x))
import basin
import string
from hashlib import sha1
## Fixed-length compact ids for compound keys. Given one or more strings, this will
## concat with delim (default '|'), sha1 hash the result, convert to the given base
## (default 62), truncate to the given length (default 12) and left-pad with zeros.
##
## *** WARNING MATH AHEAD ***
## Here's a handy way to approximate the birthday number for a given bitspace and a
@mandiwise
mandiwise / Count lines in Git repo
Last active May 9, 2024 05:41
A command to calculate lines of code in all tracked files in a Git repo
// Reference: http://stackoverflow.com/questions/4822471/count-number-of-lines-in-a-git-repository
$ git ls-files | xargs wc -l