Skip to content

Instantly share code, notes, and snippets.

View haskell-db-comparison.md

Haskell DB Library Comparison

We will be comparing the following DB libraries:

  • HRR
  • Opaleye
  • Persistent + Esqueleto
  • Groundhog
  • postgresql-simple (and postgresql-transactional)
@cdepillabout
cdepillabout / fetch-dhall-as-binary.nix
Created Sep 14, 2021
demonstrate how to fetch URL imports in Dhall by turning the integrity checks into Nix fixed-output-derivations
View fetch-dhall-as-binary.nix
with import <nixpkgs> {};
let
packageSet = fetchurl {
url = "https://github.com/purescript/package-sets/releases/download/psc-0.14.4-20210905/packages.dhall";
# The hash below is a base64-encoded version of the base-16 hash that is
# specified in our local packages.dhall file:
# ```
# $ cat packages.dhall
# let upstream =
@cdepillabout
cdepillabout / existential-vs-sigma.hs
Last active Jun 11, 2021
This file shows how similar existential types are vs. sigma types (dependent pairs).
View existential-vs-sigma.hs
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE PolyKinds #-}
@cdepillabout
cdepillabout / example.nix
Last active May 6, 2021
Example of overriding a GHC core Haskell package with Nix
View example.nix
# This file is an example of overriding a GHC core Haskell library (like
# bytestring, containers, text, unix, etc) when building a Haskell package.
let default-nixpkgs =
builtins.fetchTarball {
# nixpkgs haskell-updates branch as of 2019/09/15.
url = "https://github.com/NixOS/nixpkgs/archive/a51b3367ab6acc72630da0bad50ce14fa86996d0.tar.gz";
sha256 = "05d3jxxk5dxzs9b3nan16lhkrjnzf0bjd4xy66az86fsafnrr9rd";
};
in
@cdepillabout
cdepillabout / shell.nix
Last active Jan 24, 2021
shell.nix for Python development using virtualenv and pip
View shell.nix
let
nixpkgs-src = builtins.fetchTarball {
# master of 2021-01-05.
url = "https://github.com/NixOS/nixpkgs/archive/1a57d96edd156958b12782e8c8b6a374142a7248.tar.gz";
sha256 = "1qdh457apmw2yxbpi1biwl5x5ygaw158ppff4al8rx7gncgl10rd";
};
pkgs = import nixpkgs-src {
config = {
# allowUnfree may be necessary for some packages, but in general you should not need it.
@cdepillabout
cdepillabout / transformers-tests.hs
Last active Jan 24, 2021
examples of output of various monadic functions with different monad transformer orders
View transformers-tests.hs
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Monad.Except
import Control.Monad.State
import Control.Monad.Writer
import Data.Functor.Identity
import Data.Text (Text)
@cdepillabout
cdepillabout / continuations.hs
Created Jan 5, 2021
Examples of playing around with continuations in Haskell
View continuations.hs
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Example where
import Control.Concurrent.MVar
import Control.Monad.IO.Class
import Control.Monad.Trans.Cont
import Data.Foldable
import Data.Monoid
@cdepillabout
cdepillabout / README.md
Created Apr 22, 2020
shell.nix to enable training ML models remotely with the GCP AI Platform
View README.md
@cdepillabout
cdepillabout / juggling-data
Last active Mar 14, 2020
Days practicing 5 minutes of juggling, and days new records were set
View juggling-data
Index,Date,NewRecord
0,2019-06-23
1,2019-06-24
2,2019-06-25
3,2019-06-26
4,2019-06-27
5,2019-06-28
6,2019-06-29
7,2019-06-30
8,2019-07-01
@cdepillabout
cdepillabout / purescript-build-output-err-haddock.txt
Last active Nov 6, 2019
Error when building purescript with --haddock option to stack
View purescript-build-output-err-haddock.txt
Building library for purescript-0.13.4..
[ 1 of 163] Compiling Control.Monad.Logger
[ 2 of 163] Compiling Control.Monad.Supply
[ 3 of 163] Compiling Control.Monad.Supply.Class
[ 4 of 163] Compiling Language.PureScript.Comments
[ 5 of 163] Compiling Language.PureScript.AST.SourcePos
[ 6 of 163] Compiling Language.PureScript.Crash
[ 7 of 163] Compiling Language.PureScript.AST.Operators
[ 8 of 163] Compiling Language.PureScript.Docs.Css
[ 9 of 163] Compiling Language.PureScript.Docs.Utils.MonoidExtras