Skip to content

Instantly share code, notes, and snippets.


Dmitri Zaitsev dmitriz

View GitHub Profile
dmitriz / install errors
Created Aug 27, 2019
stack install package
View install errors
➜ ~ stack install sized
Error: While constructing the build plan, the following exceptions were encountered:
In the dependencies for sized-
equational-reasoning must match >=0.5, but the stack configuration has no specified version (latest matching
version is
ghc-typelits-presburger must match >=, but the stack configuration has no specified version (latest
matching version is
View stack struggles
With no local config present, `stack` is picking the old ghc 8.2.2:
➜ test stack ghci
Note: No local targets specified, so a plain ghci will be started with no package hiding or package options.
You are using snapshot: lts-11.9
If you want to use package hiding and options, then you can try one of the following:
dmitriz / fmap
Created Aug 17, 2019
ghci errors
View fmap
λ [9]: fmap f [1]
Out [9]:
<interactive>:186:1: error:
• Ambiguous type variable ‘f0’ arising from a use of ‘print’
prevents the constraint ‘(Show (f0 Integer))’ from being solved.
Probable fix: use a type annotation to specify what ‘f0’ should be.
These potential instances exist:
instance Show a => Show (ZipList a)
-- Defined in ‘Control.Applicative’
dmitriz / build
Created Aug 15, 2019
Installing ptghci
View build
Trying to install
✗ cabal v2-build
Build profile: -w ghc-8.0.1 -O1
In order, the following will be built (use -v for more details):
- ptghci- (lib) (first run)
- ptghci- (exe:ptghci) (first run)
Preprocessing library for ptghci-
Building library for ptghci-
dmitriz / cabal
Created Aug 15, 2019
Cabal errors
View cabal
✗ cabal v2-build
Warning: The package list for '' does not exist. Run 'cabal
update' to download it.
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] next goal: ptghci (user goal)
[__0] rejecting: ptghci- (conflict: pkg-config package python3-any, not
found in the pkg-config database)
[__0] fail (backjumping, conflict set: ptghci)
After searching the rest of the dependency tree exhaustively, these were the
dmitriz / ghcup
Created Aug 15, 2019
Haskell errors
View ghcup
✗ ghcup install
Installing GHC-8.6.5 for Darwin on architecture x86_64
usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
mktemp [-d] [-q] [-u] -t prefix
Failed to create temporary directory

High level style in javascript.

Opinions are like assholes, every one has got one.

This one is mine.

Punctuation: who cares?

Punctuation is a bikeshed. Put your semicolons, whitespace, and commas where you like them.

dmitriz / myRSI.js
Created Jan 10, 2018 — forked from howie50417/myRSI.js
View myRSI.js
var _ = require('lodash');
var log = require('../core/log.js');
var RSI = require('./indicators/RSI.js');
// let's create our own method
var method = {};
// prepare everything our method needs
method.init = function() {
View gist:4d5f0ffcad33a75f3a534df3a330eb30

Let us make the array functor slightly uglier.

According to Functor's definition, for every type a, we first need to define the type F(a), the set of all admissible values for our Functor.

For the array Functor Array, that would be the set [a] of all arrays with entries of type a.

We now define a new Functor F, where we slightly change the set of values F(a): Namely, we say that an array arr is of type F(a) if either

dmitriz / db-alt.js
Created May 13, 2017 — forked from i-am-tom/db-alt.js
Database failover modelled with the `alt` typeclass.
View db-alt.js
const Task = require('data.task')
Task.prototype.alt = function (that) {
return new Task((rej, res) =>
this.fork(_ => that.fork(rej, res), res))
const hosts = [
[ '', 'user', 'password' ],
[ '', 'user', 'password' ],