Basic unit type:
λ> replTy "()"
() :: ()
Basic functions:
Basic unit type:
λ> replTy "()"
() :: ()
Basic functions:
At DICOM Grid, we recently made the decision to use Haskell for some of our newer projects, mostly small, independent web services. This isn't the first time I've had the opportunity to use Haskell at work - I had previously used Haskell to write tools to automate some processes like generation of documentation for TypeScript code - but this is the first time we will be deploying Haskell code into production.
Over the past few months, I have been working on two Haskell services:
I will write here mostly about the first project, since it is a self-contained project which provides a good example of the power of Haskell. Moreover, the proces
# List of all the valid pdf URLs ever posted to the #Clojure IRC channel. | |
# | |
# Many of them are interesting CS papers others are not that useful. What I've done: | |
# | |
# 1. crawled an IRC history archive for the channel | |
# 2. extract pdf list in a file with: grep -riIohE 'https?://[^[:space:]]+pdf' * > pdf-links.txt | |
# 3. remove dupes: cat pdf-links.txt | sort | uniq > pdf-links-uniq.txt | |
# 4. filter only HTTP 200: cat pdf-links-uniq.txt | xargs curl -o /dev/null --connect-timeout 2 --silent --head --write-out '%{http_code} %{url_effective}\n' | grep "^200" > valid-pdf-links.txt | |
# | |
# Now your choice to download them all or not. If you want, use: cat valid-pdf-links.txt | awk '{print $2}' | xargs wget |
Goal: a consistent style throughout all Elm projects that is easy to read and produces clean diffs to make debugging easier. This means valuing regularity and simplicity over cleverness.
Keep it under 80 characters. Going over is not the end of the world, but consider refactoring before you decide a line really must be longer.
/* | |
* Copyright (c) 2013 by Wil Tan <[email protected]> | |
* | |
* Based on dump_dns.c from the dnscap <https://www.dns-oarc.net/tools/dnscap> | |
* originally written by Paul Vixie. | |
* | |
* Copyright (c) 2007 by Internet Systems Consortium, Inc. ("ISC") | |
* | |
* Permission to use, copy, modify, and/or distribute this software for any | |
* purpose with or without fee is hereby granted, provided that the above |
HTTP transfer protocols | |
======================= | |
Git supports two HTTP based transfer protocols. A "dumb" protocol | |
which requires only a standard HTTP server on the server end of the | |
connection, and a "smart" protocol which requires a Git aware CGI | |
(or server module). This document describes both protocols. | |
As a design feature smart clients can automatically upgrade "dumb" | |
protocol URLs to smart URLs. This permits all users to have the |
/* windows */ | |
typedef HMODULE uv_lib_t; | |
#define UV_CALL FAR WINAPI | |
/* unix */ | |
typedef void* uv_lib_t; | |
#define UV_CALL |
var weak = require('weak') | |
// This is our weakmap; a regular JS Object | |
var map = {} | |
// This is the object we wanna store a weak reference to | |
var anObj = { foo: 'bar' } | |
, key = 'anObj' | |
// Create a weak reference and store it in the map. |
#! /usr/bin/env python | |
""" Convert values between RGB hex codes and xterm-256 color codes. | |
Nice long listing of all 256 colors and their codes. Useful for | |
developing console color themes, or even script output schemes. | |
Resources: | |
* http://en.wikipedia.org/wiki/8-bit_color | |
* http://en.wikipedia.org/wiki/ANSI_escape_code |