Skip to content

Instantly share code, notes, and snippets.

loop :: Show a => Int -> a -> String;
loop 0 x = show x;
loop n x = loop (n-1) [x];
patrik@ariakenom ~/h/cabal> nix-shell -p zlib pkgconfig --run "cabal v1-build"
Resolving dependencies...
Warning: solver failed to find a solution:
Could not resolve dependencies:
[__0] trying: hello-0.1.0.0 (user goal)
[__1] unknown package: lens (dependency of hello)
[__1] fail (backjumping, conflict set: hello, lens)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: hello, lens
Trying configure anyway.
def _queue_get(q, timeout):
"""
The timeout of Queue.get has a precision of ~16ms on Windows.
In order to get more precision we poll the last few ms.
"""
t0 = time.perf_counter()
SLEEP_PRECISION = time.get_clock_info('monotonic').resolution
try:
return q.get(timeout=timeout-SLEEP_PRECISION)
except queue.Empty: