Skip to content

Instantly share code, notes, and snippets.

@Kludgy
Kludgy / stack-1.7.1-solver-empty-error
Created July 18, 2018 17:44
Empty cabal-install errors when invoking stack-1.7.1 solver
λ stack solver --verbose
Version 1.7.1, Git revision 681c800873816c022739ca7ed14755e85a579565 (5807 commits) x86_64 hpack-0.28.2
2018-07-18 10:36:50.552854: [debug] Checking for project config at: ...\emptyerror\stack.yaml
@(src/Stack\Config.hs:850:9)
2018-07-18 10:36:50.554854: [debug] Loading project config file stack.yaml
@(src/Stack\Config.hs:876:13)
2018-07-18 10:36:50.562352: [debug] Decoding build plan from: ...\AppData\Roaming\stack\build-plan\lts-12.1.yaml
@(src/Stack\Snapshot.hs:164:5)
2018-07-18 10:36:50.563854: [debug] Trying to decode ...\AppData\Roaming\stack\build-plan-cache\lts-12.1.cache
@(src/Stack\Snapshot.hs:156:32)
@Kludgy
Kludgy / AOC2017Day3Part1.hs
Last active December 14, 2017 08:41
Advent of Code 2017 Day 3, Part 1
module AOC2017 where
{-
daythree
Observation that cycles are of length 8n
(/ mod four sides of the square) so each
cycle's index starts at (2n-1)^2:
n cycle/4 length index
@Kludgy
Kludgy / month_subtraction.cc
Created June 28, 2016 20:33
Defining subtraction in terms of conjugation of integers-modulo-n
/*
Consider the solution for adding months (o) to a date consisting of the month (m) and year (y):
Let
o >= 0
1 <= m <= 12
y > 0
@Kludgy
Kludgy / CppSqlBindingAttempt.cpp
Last active May 8, 2016 04:21
One approach to the typing row data in C++11.
/*
One possible approach to typing SQL result sets in C++11.
TODO: Nominal row type APIs to disambiguate different row schemas that happen to have the same field descriptions.
*/
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
@Kludgy
Kludgy / SqlIntegralCastTMP.cpp
Last active May 8, 2016 04:45
Attempt at parity between cache and MySQL int-int casting semantics.
#include <iostream>
#include <limits>
#include <algorithm>
using std::numeric_limits;
using std::min;
using std::max;
using std::cout;
using std::endl;