Skip to content

Instantly share code, notes, and snippets.

View heath's full-sized avatar
❄️
λΠ

heath

❄️
λΠ
View GitHub Profile
  1. what are some methods you use to maintain a clean codebase?
  2. how does haskell help you to maintain a clean, decoupled codebase?
  3. what system design benefits do you receive from a statically typed, pure language such as haskell, that you wouldn’t receive in a dynamically typed, but immutable language?

Response 1

they all seem to be the same question to me. without static types, you never see any non-trivial level of generalisation. That’s because it’s humanly intractable. Dynamically-typed languages are simply compiler outputs and should never be handwritten. Those generalisations are what it means (afaic) to keep a code base clean, maintainable, and decoupled.

@heath
heath / Main.elm
Last active September 27, 2016 16:45
module Main exposing (..)
import DOM exposing (target, offsetWidth)
import Html exposing (..)
import Html.App as App
import Html.Attributes exposing (href, class, style)
import Html.Events exposing (on)
import Material
import Material.Scheme
import Material.Button as Button
@heath
heath / fgrep.md
Last active August 29, 2015 14:16 — forked from dherman/fgrep.md

How Would You Write fgrep?

This is a little style and expressiveness test for various stream libraries. It is certainly not a proof of anything, so much as an ability to showcase how some basic features of streams fit together with different libraries.

Problem statement: given a library of streams, implement an API analogous to fgrep, i.e., a literal string grepper.

Specifically, implement a function fgrep(test, filenames[, limit=10]), which takes a source string, a list of filenames, and an optional concurrency limit, and produces a stream of Match records { filename: string, lineNumber: number, line: string }, representing all lines of all files that contain the string test. For each matching record, filename is the name of the file where the match was found, lineNumber is the one-indexed line number where the match was found, and line is the contents of the line where the match was found.

The limit argument indicates the maximum number of concurrent filehandles that should b

#!/usr/bin/env node
requireCoffee = process.argv.some(function(arg){
return arg == "-c" || arg == "--coffee"
})
if (requireCoffee) {
var coffee = require("coffee-script");
global.coffee = true;
console.log("using coffeescript")
}
@heath
heath / grub.cfg
Created June 27, 2014 00:37
default grub entry for nixos
set default=0
set timeout=10
if loadfont /boot/grub/unicode.pf2; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
terminal_output gfxterm
insmod png
(defproject omtut-starter "0.1.0-SNAPSHOT"
:description "FIXME: write this!"
:url "http://example.com/FIXME"
:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/tools.reader "0.8.2"]
;; CLJ
[ring/ring-core "1.2.0"]
[compojure "1.1.6"]
[cheshire "5.2.0"]
[
{ "Name" : "Abraham Lincoln Birthplace National Historical Park", "pos" : [-85.7302 , 37.5332 ] },
{ "Name" : "Abraham Lincoln National Cemetery", "pos" : [-88.12595 , 41.3896 ] },
{ "Name" : "Acadia National Park", "pos" : [-68.04902 , 44.454 ] },
{ "Name" : "Adams National Historical Park", "pos" : [-71.01119 , 42.25639 ] },
{ "Name" : "Admiralty Island National Monument", "pos" : [-134.16105 , 57.61806 ] },
{ "Name" : "African American Civil War Memorial", "pos" : [-77.02569 , 38.91639 ] },
{ "Name" : "African Burial Ground National Monument", "pos" : [-73.99364 , 40.71367 ] },
{ "Name" : "Agate Fossil Beds National Monument", "pos" : [-103.75492 , 42.42428 ] },
{ "Name" : "Agua Fria National Monument", "pos" : [-112.07633 , 34.15417 ] },
@heath
heath / fun.js
Created May 15, 2014 18:20 — forked from jorendorff/fun.js
// Here is an example of a plain old function that returns a promise.
// Nothing magic about that.
function sleep(sec) {
return new Promise(function (resolve, reject) {
setTimeout(function () {
resolve(undefined);
}, sec * 1000);
});
}
[hsenv](d)
# heath at mbp112 in ~ [20:30:06]
$ cabal install ihaskell
Resolving dependencies...
In order, the following will be installed:
ansi-terminal-0.6.1.1 (new package)
base64-bytestring-1.0.0.1 (new package)
byteable-0.1.1 (new package)
cereal-0.3.5.2 (new package)
cryptohash-0.11.4 (new package)