Skip to content

Instantly share code, notes, and snippets.

{-# LANGUAGE PackageImports #-}
module EasyPool
( EasyPool
, withEasyPool
, newEasyPool
) where
import Pool
import Control.Monad.STM
@quchen
quchen / trolling_haskell
Last active February 24, 2024 01:30
Trolling #haskell
13:15 <xQuasar> | HASKELL IS FOR FUCKIN FAGGOTS. YOU'RE ALL A BUNCH OF
| FUCKIN PUSSIES
13:15 <xQuasar> | JAVASCRIPT FOR LIFE FAGS
13:16 <luite> | hello
13:16 <ChongLi> | somebody has a mental illness!
13:16 <merijn> | Wow...I suddenly see the error of my ways and feel
| compelled to write Node.js!
13:16 <genisage> | hi
13:16 <luite> | you might be pleased to learn that you can compile
| haskell to javascript now
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
@jamesdabbs
jamesdabbs / haxl-persistent.hs
Created June 11, 2014 04:00
[WIP] Fixing Persistent n+1's with Haxl
{-# LANGUAGE TupleSections, OverloadedStrings, StandaloneDeriving, FlexibleInstances #-}
module Handler.Home where
import Import
import Data.Int (Int64)
import qualified Data.Text as T
-- Haxl imports
import Data.Hashable
@david-christiansen
david-christiansen / FizzBuzzC.idr
Last active August 29, 2022 20:00
Dependently typed FizzBuzz, now with 30% more constructive thinking
module FizzBuzzC
%default total
-- Dependently typed FizzBuzz, constructively
-- A number is fizzy if it is evenly divisible by 3
data Fizzy : Nat -> Type where
ZeroFizzy : Fizzy 0
Fizz : Fizzy n -> Fizzy (3 + n)
@bennofs
bennofs / doc.md
Last active June 15, 2024 14:40
Overview of the NixOS X11 session modules

How X11 is started

In the following example, sddm will be used as a display manager. The process is however similar for other display managers in nixpkgs and a summary that applies to all nixpkgs display managers is given at the end.

  1. Systemd unit "display-manager.service" starts services.x11.displayManager.job.execCmd (the display manager)

    Code reference: <nixpkgs>/nixos/modules/services/x11/xserver.nix

  2. services.x11.displayManager.job.execCmd is set to the path of the sddm binary from the sddm package in the nix store. So SDDM will start and read its configuration from /etc/sddm.conf.

-- stack --resolver lts-10.3 --install-ghc runghc --package fmt --package base-prelude --package optparse-applicative --package text
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE ApplicativeDo #-}
-- | A small program replicating a part of @aws-cli@ (only the interface,
-- not the functionality).
module Main where
@chrispsn
chrispsn / kOS.md
Last active June 1, 2024 12:38
A summary of everything we know about kOS.
@beardedtim
beardedtim / monads.md
Last active July 18, 2022 16:40
Monads are like burritos...and trees...and clocks...and...

Monads and Why The Hell We Need Weird Words

Once you understand what monads are, and why they exist, you lose the ability to explain it to anybody.

Here's to hoping I don't understand them

Table of Contents

Some thoughts on building software

Lately I have been busy reading some new books on Domain Driven Design (DDD) and software architecture -- including a short yet eye-opening one in Python and a great one in F#. At the same time, it seems that more people in the Functional Programming world are looking at more formal approaches to modelling -- some examples here. This has brought some thought from the background of my brain about how we should model, organize, and architect software using the lessons we've learnt from functional programming.

Before moving on, let me be clear about this being just a dump of some thoughts, not always well-defined, definite