Skip to content

Instantly share code, notes, and snippets.

View qrilka's full-sized avatar
🖥️
as always

Kirill Zaborsky qrilka

🖥️
as always
  • FP Complete
  • Arkhangelsk, Russia
View GitHub Profile
@chrisdone
chrisdone / XMLParser.hs
Last active January 17, 2020 15:07
XMLParser wrapper for xml-conduit
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE PartialTypeSignatures #-}
{-# LANGUAGE ParallelListComp #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE DisambiguateRecordFields #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
@parsonsmatt
parsonsmatt / no-thanks-acid-state.md
Created December 17, 2018 18:46
acid state antirecommendation

Someone asked whether or not acid-state was production ready. I shared my experiences:

parsonsmatt [11:32 AM] @nikolap it's used by cardano-wallet and Hackage. Based on my experience with acid-state, I'd say it is not a good choice for production data storage. For local desktop apps, SQLite is a much better choice, and for real production apps, Postgresql is king.

parsonsmatt [11:44 AM] acid-state did not have a test suite, at all, until I implemented the very first tests (for TemplateHaskell code generation) earlier this year. It has picked up some tests since then, but I'm still not confident in it's correctness.

It claims to be resilient to unplugging the power cord, but I doubt that, as it's not resilient to Ctrl-C: acid-state/acid-state#79

@corpix
corpix / nix-deploy.md
Last active August 11, 2019 12:31
Scripts to deploy NixOS machines without nixops/nix-deploy/etc...

Requirements:

  • root directory is a git repository(for git rev-parse --show-toplevel)
  • github.com/nixos/nixpkgs at pkgs/nixpkgs

Tree:

.
├── .git
@cblp
cblp / Xlsx.hs
Created February 14, 2018 09:42
-- stack --resolver=lts-10.5 script
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE Rank2Types #-}
module Write where
import Codec.Xlsx
import Control.Lens
import Control.Monad.State.Strict
@taktoa
taktoa / haskell-pain-points.md
Last active October 26, 2019 04:18
A rant about pain points in Haskell, written as a response to https://redd.it/7rwuxb

I started writing this polemic to answer your question, but I ended up touching on most of my gripes with Haskell in general, not just in a corporate context.

GHC

GHC is a modern compiler with an amazing RTS and tons of features, but I have some issues with it.

Monolithic and Hard to Contribute To

@matklad
matklad / idea.nix
Last active February 10, 2023 17:58
Using JetBrains JDK with Intellij IDEA on nixos
# Put this file into `~/.config/nixpkgs/overlays/idea.nix`.
# Then, install IDEA with `nix-env -iA nixos.idea-community`.
self: super:
{
jbsdk = super.callPackage ~/config/nix/jbsdk.nix {}; # you might need to override this path.
idea-community = let
version = "2017.2.3";
@jboner
jboner / latency.txt
Last active June 29, 2024 19:54
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@klapaucius
klapaucius / _post.md
Last active November 7, 2021 22:36
spine-strict_lists

Строгость и нищета списков.

Map и структурная рекурсия.

Применить функцию к каждому элементу списка - это просто:

GHC/Base.lhs

map _ []     = []
map f (x:xs) = f x : map f xs